fopen create new file that not exists

Posted by user306449 on Stack Overflow See other posts from Stack Overflow or by user306449
Published on 2010-03-31T23:10:34Z Indexed on 2010/03/31 23:13 UTC
Read the original article Hit count: 345

Filed under:
|
|
|

Hey,

I am trying to either create a file that doesn't exist or write to a file that already does.

within a php file I am trying this:

$file = fopen("data.txt", "a"); fwrite($file, "\n" . $name); fwrite($file, "," . $lastname); fwrite($file, "," . $email); fclose($file);

I am running Apache under windows Xp and have no luck that the file "data.txt" is being created. The docs say that adding the a parameter should create a file with a name mentioned in the fist parameter (data.txt). what am I doing wring here?

Thanks in advance undersound

© Stack Overflow or respective owner

Related posts about fopen

Related posts about php