Hi,
I must have done something wrong,
but I just can not see what it is :o
This is my code to open a file:
(I do this just before my cURL )
Strange thing is, my logfile opens fine, just the feeder.zip
gives me the problem.
$log_file = "/home/public_html/a_log.txt";
$handle = fopen("$log_file", "a");
$logstamp = date('H:i:s l, j F Y', $today);
$content = "----------------------------------------------- \r\nNew record - Time Stamp: $logstamp \r\n";
fwrite($handle, $content);
$content = "This script: update.php, This file: $log_file\r\n";
fwrite($handle, $content);
$target_url = "http://www.example.com/feed.xml.zip";
$userAgent = 'EasyDL/3.xx';
$file_zip = "feeder.zip";
$cef = "curl_err.txt";
$ceh = fopen($cef, 'w');
$content = "Target_url: $target_url\r\n";
fwrite($handle, $content);
// make the cURL request to $target_url
$ch = curl_init();
$fp = fopen("$file_zip", "wb");
if ($fp === FALSE ) {
$content = "Problem opening $file_zip\r\n";
fwrite($handle, $content);
exit;
}
So my log shows:
-----------------------------------------------
New record - Time Stamp: 02:03:34 Wednesday, 27 January 2010
This script: update.php, This file: /home/public_html/a_log.txt
Target_url: http://www.example.com/feed.xml.zip
Problem opening feeder.zip
Is there something wrong with:
if ($fp === FALSE ) ?
Can anyone see what I am doing wrong ?
Thanks
.