So I am creating an HTML form that is being submitted using php and being saved to a text file. What I want to do now is take that data and reinject it into the form, so that it looks the exact same as when someone comes back to the site. In other words, making the form save itself. I want to use php and save data to a text file because I can't figure out mySQL. The form itself is based on HTML and JavaScript. It contains text areas and check boxes. Any help is greatly appreciated. Also I want the form to be the same for everyone who looks at it. Long story why, but yah.
Announcement
Collapse
No announcement yet.
Memorize form
Collapse
X
-
I'm afraid that if you want your site to remember a users form details you will have to get to grips with mysql.
You could store the data temporarily in a session (which is basically an array called $_SESSION) but many browsers do not save session id data when they are closed. Also using text files is totally unsecure and not even thread safe meaning that two users could alter it at the same time and you'd have corrupt data.
I know MySQL sounds scary but it really is simpler than you realise. It's thread safe and takes care of everything for you in a table similar to a spreadsheet (except more advanced so you can run searches etc).
If you've not been there, tizag.com have excellent tutorials."Tango says double quotes with a single ( ' ) quote in the middle"
'$Name says single quotes with a double ( " ) quote in the middle'
"Tango says double quotes ( \" ) must escape a double quote"
'$Name single quotes ( \' ) must escape a single quote'
Comment
-
-
Show us an example of the form, and if you are using checkboxes,
will the checkboxes be numbered, or will each checkbox have a description
next to them ... I'm wondering if you only care about which boxes were
checked, not specifically the word (or value) of it. As you mentioned, you
will redisplay the same form with the checkboxes checked from the last
person that viewed the form. Each viewer can change the checkboxes and
resubmit the form, overwriting the previous viewer's choices?
I'm working off of this ....
.
Comment
-
Comment