Hi,
I'm trying to write a file, using this code:
$myfile = "c:\wamp\www\testes.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Tracy Tanner\n";
fwrite($fh, $stringData);
fclose($fh);
I'm using WAMP on Windows Vista, I have total permissions to everybody on c:\wamp\www
But I can't write the file and get "can't open file".
Thanks for your help.
Pedro
fopen file - help !!!
Moderator: General Moderators
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: fopen file - help !!!
Change:
To:
Note I've only replaced the double-quotes with single-quotes. The \t is a special character (tab) that will be escaped in a double-quoted string.
Code: Select all
$myfile = "c:\wamp\www\testes.txt";Code: Select all
$myfile = 'c:\wamp\www\testes.txt';Re: fopen file - help !!!
Thanks for your tip, and I think that was one of the problems, but it still gives-me the same msg.
"can't open file"
This is my first time using php on windows environment, and has I told, I've put "full control" permissions to everyone, but I want to ask if someone knows the user that is used in vista by apache.
Thanks.
Pedro
"can't open file"
This is my first time using php on windows environment, and has I told, I've put "full control" permissions to everyone, but I want to ask if someone knows the user that is used in vista by apache.
Thanks.
Pedro