Re: append line to text file HELP !!!

From: Date: Mon, 29 Apr 2002 03:51:49 +0000
Subject: Re: append line to text file HELP !!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-95071@lists.php.net to get a copy of this message
On 29 Apr 2002 at 0:26, Rodrigo wrote: > Ok guys, this is the code and under it you can see what I get when I try > to submit the form. > > > <?php > $file_pointer=file('emails.txt','a') || exit; > $string_to_write = ("$newmail")."\n"; > $s=fopen($file_pointer,$string_to_write); > $s=fclose($fp); > ?> > > > Warning: Supplied argument is not a valid File-Handle resource in > /home/restricted/home/h4ck3r/public_html/write.php on line 4 > > Warning: Supplied argument is not a valid File-Handle resource in > /home/restricted/home/h4ck3r/public_html/write.php on line 6 > I haven't actually checked your code on my development box and I haven't done file i/o for a while so this does not address any syntax errors that might exist, but... What is the operating system? Do you have sufficient permissions to be writing files in that directory? What permissions are set on the file you're trying to append to? If you can't work with files in that directory because of directory permissions then it won't work. If the file has permissions that prevents the web server process from accessing it then you also won't be able to get it working. CYA, Dave

« previous php.general (#95071) next »