PHP Curl
PHP
Download (.zip)
<?php // // The PHP curl module supports the received page to be returned // in a variable if told. // If (isset($_POST['submit']) && ($_POST['url'] ne '')) { // we got an URL, let's fetch it! $ch = curl_init();
curl_setopt($ch, CURLOPT_URL,); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result = curl_exec ($ch); curl_close ($ch); print $result; } else { // no URL posted, let's print out a form! ?> <html><body> <h3><font color=\"00cf10\">Fetch a remote page and display in the browser window</font></h3> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Enter URL to fetch: <input type="text" name="url" size="50" value="http://www.php.net/"></input> <input type="submit" name="submit" value="Get it!"></input> </form> <?php } ?>
|