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.
fopen is not working
Moderator: General Moderators
-
prashantAG
- Forum Newbie
- Posts: 7
- Joined: Wed Apr 30, 2008 1:31 am
Re: fopen is not working
do the following any one gave u soln
1.check the correct path before hosting, i.e. fopen()
2. in u r code file don't include header(),location("") function.you better to use redirect .
3. gave full path like fopen("c:mydoc\findchip\findchip_to_replace.html")
1.check the correct path before hosting, i.e. fopen()
2. in u r code file don't include header(),location("") function.you better to use redirect .
3. gave full path like fopen("c:mydoc\findchip\findchip_to_replace.html")