When going back to a previous page because the form validation directs the user to go back due to an input error, I typically use a variable construction on the page that is doing the validation like this:
$SESSION['svMyVar'] = $POST[$my_var]; // store var from previous page as a session var
Then, when returning to the previous page I use this:
$my_var = $_SESSION['svMyVar']; // restore the original var
So, I can now repopulate the associated form field (e.g. a text input box) with the original value. Hey, nobody wants to piss off the user by making them re-enter any values, right? :queasy:
I'm not sure this is the best way to do this, but this technique works fine . . . EXCEPT when I go to clear the original form with a RESET button (maybe the user wants to start completely over, who knows?). The session vars do not clear, only non session vars are cleared.
So, how can I clear the session vars using the RESET button? (Yeah, yeah, I know, use Javascript for form validation and never leave the page. :rolleyes: But that won't help me here with the session vars).
Thanks in advance.