Topic awaiting preservation: how to read/write from form filed to txt file |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: 290 km/h, fast lane, Autobahn, Germany |
posted 10-01-2003 09:24
I am currently writing a personal start page so that I'll have bookmarks, searches in reach everywhere I go. What I would also like to have on there is some sort of an online notepad. I've seen something similar in the control panel of a bulletin board. It is basically a text field with a save and a reset button. On the next visit the stored text is automatically displayed in the text field and can be edited. I am trying to keep it simple but php would be an option. |
Maniac (V) Mad Scientist From: :morF |
posted 10-01-2003 12:15
You want to use the php->fopen() function to read the contents of your file into a variable, then when you generate the code for your text box, simply add into it's tag value="$file" (or whatever you named your file variable. When the form is then submitted you pull that data back out of the $_POST array and using fopen() to truncate the file to 0 bytes and write the contents of your text field into it. The other functions your going to need are: |
Bipolar (III) Inmate From: 290 km/h, fast lane, Autobahn, Germany |
posted 10-01-2003 15:02
thanx Skaarjj |
Maniac (V) Mad Scientist From: :morF |
posted 10-01-2003 15:42
http://www.hotscripts.com/PHP/Tips_and_Tutorials/File_Manipulation/index.html would be a good place to start |