RE: [PHP] Problem with fwrite

From: Date: Sun, 19 Nov 2000 03:05:14 +0000
Subject: RE: [PHP] Problem with fwrite
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-26085@lists.php.net to get a copy of this message
Reuben: I just cut and pasted your code in a new file, and it works perfectly. I'm using PHP4, Apache & Windows 98. ______________________________ Cristian Donoso ----- Original Message ----- From: Reuben D Budiardja <reubendb@goshen.edu> To: <php-general@lists.php.net> Sent: Saturday, November 18, 2000 1:43 PM Subject: [PHP] Problem with fwrite > > I have a simple FORM with one textbox. I want to write (append) to a file > the string people put in the textbox. However, the string is always > written double in the file. For example, if I put YAHOO in the textbox, > the file will contain: > YAHOO > YAHOO > > Why is that? Any help will be greatly appreaciated. I'm using php4, > apache, redhat linux. > > Below is my code. > > <? > if(isset($words)) > { > $words = $words ."\n"; > $fw = fopen('file.txt', 'a'); > fwrite($fw, $words); > unset($words); > fclose($fw); > } > > > echo "<HTML>"; > echo "<HEAD>"; > echo "<TITLE>Reuben-Audy Chat</TITLE>"; > echo "</HEAD>"; > echo "<BODY>"; > > echo "<P>"; > echo "<FORM ACTION=\"fwrite.php3?\" METHOD=\"POST\">"; > echo "<INPUT TYPE=TEXT NAME=\"words\" > OnChange=\"submit();\">"; > echo "</FORM>"; > echo "</P>"; > > echo "</BODY></HTML>"; > ?> > > Thanks for any help > Reuben D. Budiardja > > > -- > 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 (#26085) next »