fopen is not working
Posted: Mon May 12, 2008 12:06 am
hello everybody,
Pls go through the code below:-
$myOriginFile = "findchip/findchip_to_replace.html";
$myDestinationFile = "findchip/findchip_category" . rand() . ".html";
if (file_exists($myDestinationFile))
{
unlink($myDestinationFile);
}
$fh = fopen($myOriginFile, "w") or die("can't open file");
fwrite($fh, $myLine1);
fclose($fh);
While executing this code in my localhost its working fine but after hosting it to my web server its not working. The output it showing is - can't open file.
Any suggestions from anybody to get it rectified.
Pls go through the code below:-
$myOriginFile = "findchip/findchip_to_replace.html";
$myDestinationFile = "findchip/findchip_category" . rand() . ".html";
if (file_exists($myDestinationFile))
{
unlink($myDestinationFile);
}
$fh = fopen($myOriginFile, "w") or die("can't open file");
fwrite($fh, $myLine1);
fclose($fh);
While executing this code in my localhost its working fine but after hosting it to my web server its not working. The output it showing is - can't open file.
Any suggestions from anybody to get it rectified.