note 63319 added to faq.misc

From: Date: Mon, 20 Mar 2006 07:13:28 +0000
Subject: note 63319 added to faq.misc
Groups: php.notes 
Request: Send a blank email to php-notes+get-106087@lists.php.net to get a copy of this message
I just started learning php and wrote some simple php codes using fopen() function with different modes. With 'r' mode, it is okay, but when I wrote it with 'a' mode, it showed error of failing to create stream. The code is: <?php $file = "data.txt"; $handle = fopen($file, 'a'); fputs ($handle, 'New world!'); fclose ($handle); ?> and error message is: Warning: fopen(data.txt) [function.fopen]: failed to create stream: Permission denied in /home/cs554_12/public_html/lab4/tmp/append.php on line 3 Warning: fputs(): supplied argument is not a valid stream resource in /home/cs554_12/public_html/lab4/tmp/append.php on line 5 Warning: fclose(): supplied argument is not a valid stream resource in /home/cs554_12/public_html/lab4/tmp/append.php on line 6 And with 'w' mode, I got the same problem as above. Any help would be much appreciated! Thank you ---- Server IP: 64.71.164.2 Probable Submitter: 207.69.136.199 (proxied: 4.232.201.123) ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/faq.misc.php Edit -- http://master.php.net/note/edit/63319 Del: integrated -- http://master.php.net/note/delete/63319/integrated Del: useless -- http://master.php.net/note/delete/63319/useless Del: bad code -- http://master.php.net/note/delete/63319/bad+code Del: spam -- http://master.php.net/note/delete/63319/spam Del: non-english -- http://master.php.net/note/delete/63319/non-english Del: in docs -- http://master.php.net/note/delete/63319/in+docs Del: other reasons-- http://master.php.net/note/delete/63319 Reject -- http://master.php.net/note/reject/63319 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#106087) next »