I am using what appears to be standard fwrite code to insert html into a new page. The code takes input from a html form (url) grabs the source code using a proxy and creates a new page titled with a timestamp. All that works, what is not working is writing the html source code into the new page.
The bellow outputs a timestamp and creates a new page, however the page is empty whereas it should have code in it. Any pointers or suggestions would be much appreciated.
<? $url = $_POST['url'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
curl_setopt($ch, CURLOPT_PROXY, '123.30.185.86:3128');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,'GET');
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_exec ($ch); $curl_scraped_page = curl_exec($ch);
$FileName = time();
$FileHandle = fopen($FileName, 'w') or die("can't open
file");
fwrite($FileHandle, $curl_scraped_page);
curl_close($ch);
echo $FileName; ?>
should be just
and to output what you fetched…