Forum Moderators: coopster

Message Too Old, No Replies

something strange with fopen!

fopen(), header

         

saeed

9:25 am on May 19, 2007 (gmt 0)

10+ Year Member



Try this code in php5, for me fopen() don't create a file when I use a header command after that:

$fh=fopen($filename,'w');
fwrite($fh,$text);
fclose($fh);
header("Location: file2.php");
exit;

do you see the same?

phparion

3:58 am on May 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



check the $filename value that it has correct file name with correct path. you have permission to open / write in that folder where you are trying to create file.

saeed

8:24 am on May 21, 2007 (gmt 0)

10+ Year Member



It work when I remove header command!
is there anything related between header command and fopen?