RE: [PHP] [PHP4] $fp = fopen( "news.txt", 'a' ); // 'a' = append! Wah!

From: Date: Sun, 25 Mar 2001 18:41:43 +0000
Subject: RE: [PHP] [PHP4] $fp = fopen( "news.txt", 'a' ); // 'a' = append! Wah!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45503@lists.php.net to get a copy of this message
i believe there was a post about 10 messages ago regarding this same problem--try fseek: http://www.php.net/manual/en/function.fseek.php -jack -----Original Message----- From: Dddogbruce (@home.com) [mailto:ddogbruce@home.com] Sent: Sunday, March 25, 2001 1:36 PM To: php-general@lists.php.net Subject: [PHP] [PHP4] $fp = fopen( "news.txt", 'a' ); // 'a' = append! Wah! I'm writing a news script, and I just got it working earlier this morning. Now it writes the variables from the form to the .txt file; but when I go to write again (another news article) it does it beside, not above. Me, thinking so brilliantly at 6AM, thought append would mean above, but it means beside. This is the script in working condition, although it only writes one varibale since I was testing. I'm not using mysql, only a .txt file and two PHP documents. <? if( $formSubmit ) { echo "Your news has been processed."; $newsSubmit = file( "news.txt" ); $fp = fopen( "news.txt", 'a' ); fwrite( $fp, $frmName ); fclose( $fp ); } else { include ( "newsForm.php" ); } ?> What I want it to do is post $frmName in the .txt file, and when another entry is processed it will add that above. I hope this is possible, because I don't have access to a MySQL database *yet.* Post all suggestions, please. -Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#45503) next »