I'm trying to send my Curl output to a file for processing into my database.

The following code creates the file but nothing is being written to the file.

FYI: This is hosted on a Godaddy Reseller account - As I understand it this is the only way I can do this.

Anyone see my issue?

Code Start
<?PHP

$fh = fopen('/home/content/s/t/e/steve1040/html/cwrrefresh.txt','w');
$URL="https://shop.cwrelectronics.com/feeds/productdownload.php?fields=sku,qty,price&delim=csv&ohtime=1212278400&invtype=stock&id=MPB_MzU4MzQyMzU4MzQyNzk5";
if (isset($GET["site"])) { $URL = $GET["site"]; }
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY,"http://proxy.shr.secureserver.net:3128");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_URL, $URL);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
curl_setopt ($ch, CURLOPT__FILE, $fh);
curl_exec ($ch);
curl_close ($ch);
fclose($fh)
?>

Code End

    what are error messages (if any) and I believe CURLOPT__FILE has 2 underscores in your code and should be CURLOPT_FILE.

      Write a Reply...