Need PHP help.

moorehed

Member
Apr 6, 2000
63
0
0
ok so im trying to code something in PHP. I've never done this before and basically i have a form, and then i want data from the form to be written to a text file. heres what i have so far:

<?php
if(file_exists("test.txt"))
{
$fp = fopen("test.txt", "r+");
fwrite($fp, $news);
fclose($fp);
}
else
{
$fp = fopen("test.txt", "wb");
fwrite($fp, $news);
fclose($fp);
}

?>

easy write? ok yeah. but i'm getting this:

Warning: fopen("test.txt","wb") - Permission denied in /home/public_html/htdocs/form_test.php on line 14

so it looks like i just dont have permission to write to the directory or something? i cant change the chmod i think cause its a windows server? not sure but thats what the ftp client is telling me... is there something i have to do to give my script rights to create/write to a file? thanks!


 

Damascus

Golden Member
Jul 15, 2001
1,434
0
0
Well it looks like a Unix server, but Win2K systems have permissions as well.
If you can't change the permissions, looks like you'll have to bug some people. :)