bluesugar
Programmer
- Mar 5, 2008
- 2
I am trying to write on a text file. I get this message. Not sure what am I doing wrong. I checked the permission on the file, it has all the checkbox checked for "allow". I am hosting the site on a web hosting site.
Warning: fopen(testFile.txt) [function.fopen]: failed to create stream: Permission denied in c:\websites\sntradersonline22\guidancellc.com\contactsend.php on line 9
can't open file
Warning: fopen(testFile.txt) [function.fopen]: failed to create stream: Permission denied in c:\websites\sntradersonline22\guidancellc.com\contactsend.php on line 9
can't open file
Code:
$opinion=$_POST['opinion'];
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $opinion;
fwrite($fh, $stringData);
fclose($fh);