841
General Discussions / REPLACE
« on: May 17, 2006, 04:20:49 PM »
So I can assume it's working for you and you just needed to talk about it with us? ;-)
John
John
Forum Registration Disabled - Send a request to support@scriptbasic.org to join the forum.
User Guide
Developers Guide
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
*** getweb.bas ***
#!/usr/bin/scriba -c
INCLUDE cgi.bas
INCLUDE curl.bas
OPTION cgi$Method cgi::Post or cgi::Get
this_url = cgi::PostParam("geturl")
CURL = curl::init()
curl::option CURL,"URL",this_url
curl::option CURL,"FILE","/var/www/vhosts/scriptbasic.org/httpdocs/pagedump.txt"
curl::perform CURL
curl::finish CURL
cgi::Header 302,""
PRINT "Location: /pagedump.txt\n"
cgi::FinishHeader
END
*** curl.html ***
<html>
<head>
<title>ScriptBasic WebGet</title>
</head>
<body>
<h1>Curl Example</h1>
Enter URL to retrieve:
<form method="post" action="/cgi-bin/getweb.bas">
<input type="text" name="geturl" size=40>
<input type="submit" value="Get Page">
</form>
</body>
</html>