View Single Post
  #1 (permalink)  
Old 09-25-04, 10:46 AM
bxcheats bxcheats is offline
Newbie Coder
 
Join Date: May 2004
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Form Results To Text File

Here is what I have so far.

Form:

<form name="form1" method="post" action="submit.php">
TEXTAREA NAME=usertxt COLS=20 ROWS=5></TEXTAREA>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>

Submit.php:

<?
$fp=fopen("usertxt.txt","w");
fwrite($fp,addslashes($usertxt));
fclose($fp);
Header("location: index.html");
exit();
?>

What I want it to do is add on to the text file, not delete everything in it and add what the form says. For example I type "Joe" in on one day and the next day I type "Bob". The text file should read:

Joe
Bob

Does anyone know how to do this?
Reply With Quote