A
Anonymous
Guest
Hi, I tried writing to a file in php using the following code:
<?php
$file_name = "test.txt";
$file_pointer = fopen($file_name, "w");
fwrite($file_pointer, "what you wanna write");
fclose($file_pointer);
print "data written to file successfuly";
?>
but I keep getting an error message being:
Warning: fopen("test.txt", "w") - Permission denied in /home/scribeke/public_html/testfile/filewritetest.php on line 6
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/scribeke/public_html/testfile/filewritetest.php on line 11
Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/scribeke/public_html/testfile/filewritetest.php on line 15
data written to file successfuly
I used to be able to write to a file on this host without a problem a while ago, but now I get this, is it a script error or a host error, I don't know, I hope you guy's can tell me !
thx
scribeke
<?php
$file_name = "test.txt";
$file_pointer = fopen($file_name, "w");
fwrite($file_pointer, "what you wanna write");
fclose($file_pointer);
print "data written to file successfuly";
?>
but I keep getting an error message being:
Warning: fopen("test.txt", "w") - Permission denied in /home/scribeke/public_html/testfile/filewritetest.php on line 6
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/scribeke/public_html/testfile/filewritetest.php on line 11
Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/scribeke/public_html/testfile/filewritetest.php on line 15
data written to file successfuly
I used to be able to write to a file on this host without a problem a while ago, but now I get this, is it a script error or a host error, I don't know, I hope you guy's can tell me !
thx
scribeke