PHP
- Started
- Last post
- 9 Responses
- cosmo
Is there a way to store form values, so that once someone hits submit they can click back and the values will still appear.
Some mail forms have this features.
- JazX0
sure there is a way to do anything in programming :)
- tfs__mag0
store them in a session variable
- cosmo0
hmmm session is neat idea. Thanks.
- tfs__mag0
yeah, just make sure you kill the session variable after the form is processed...
- cosmo0
yup, got it to work thanks.
- ikbenvanrijn0
you dont have to use a session variable for a simple contact form.
can just do a simple if statement and inside the input do a value="$name"
- cosmo0
hmmmm....how would the values be passed? With an if statement, cause the values will only remain on the processing script.
- tfs__mag0
i'm not too good w/php... i always use session variables in asp to accomplish what cosmo was talking about.
the logic should be the same for asp and php. session variables are in my opinion the best way to store temporary information that your scripting will need to access across multiple pages. session variables are easy to kill once you've processed the information as well.
- enobrev0
session vars are good. If you have sensitive data that you'd rather not put into the sessions, you can put them in a db, and check for them when you show the form. Either according to the logged in user's id or sessionid