PHP Mailing list Subscription

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kishorekodru
Forum Newbie
Posts: 2
Joined: Tue Aug 16, 2005 7:09 am

PHP Mailing list Subscription

Post by kishorekodru »

Hi i m pretty new to php.

i m having the following problem while running the php file.


<?
$emailaddr = $_POST["emailaddr"];
$filename = "log.rtf";
$date = date("l F dS, Y");
$file = fopen($filename,"a");
fputs($file,"$date >> $emailaddr\n");
fclose($file);
?>



The result i m getting is :


Warning: fopen(log.rtf): failed to open stream: Permission denied in /home/is7050/public_html/subscribemail.php on line 414

Warning: fputs(): supplied argument is not a valid stream resource in /home/is7050/public_html/subscribemail.php on line 415

Warning: fclose(): supplied argument is not a valid stream resource in /home/is7050/public_html/subscribemail.php on line 416


Help me out. thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the folder (or file) you are trying to open is not read-writable by your script's user. You may be able to use chmod() to get it writable, but your script may run under a completely different user (nobody)
Post Reply