Writing & Displaying Records

From: Date: Thu, 05 Oct 2000 05:25:40 +0000
Subject: Writing & Displaying Records
Groups: php.general 
Request: Send a blank email to php-general+get-18700@lists.php.net to get a copy of this message
I have been trying to make a php file that will write the contents of an html form to a file and this just display that data. Let me give an example, I have a html form with just one text entry called data. The user is going to enter a word into this form and then once they hit submit I want the php file to write what they entered and display what other people have entered. To do this I tried: $wd=fopen("writedata.txt","a"); $wdata=fwrite($wd,$data); fclose($wd); $wd=fopen("writedata.txt","r"); $currentdata=fgets($wd,50); echo "<br>Data Currently in File: $currentdata"; but that jams all the data entered by the various users together and I can't figure out how to seperate it out when I am trying to display it. I don't know if I am writing the file wrong and it is getting crammed together or if it is the way that I am reading the file. If you know of any tutorials that can help me, or if you would be willing to give me a hand I would really appreciate it. Thanks If you want to reply personally, please remove all numbers from my address. -- Andrew V. Romero Romer1999o@pharmacy.arizona.edu Remove the #'s from my address to reply. http://www.u.arizona.edu/~avr/ ICQ #54080914

« previous php.general (#18700) next »