OK. I am new to PHP but I have been trying very hard to figure this out. I have created a SIMPLE session and password protected PHP site which flows like this:
If you try to browse directly to the index.php file, and you're session has not been authenticated you get redirected to the logon.php page. After you enter valid credentials (checked by MySQL lookup) you get sent back to the index.php. Since you successfully entered the logon info, your session is valid and you get to stay at index.php. Index.php presents you with a form which collects the various information you type in and when you press submit, I call the PHP Mail function to deliver the answers to me via e-mail. The trouble is, I have a validation step in PHP which checks the presence of a check in a checkbox. If it's there, the e-mail is sent. If it's not, you see a page telling you that you must check the box before submitting and to press back to correct your error. When you press back to correct things all of your original answers are cleared and you have to re-enter your info.
The weird thing is if I delete the PHP session check at the top of the index.php, and browse directly to index.php, complete the form and fail validation, pressing back to correct things does NOT clear the form. It seems like it has to do with the session check at the very top of index.php.
Any ideas? I can post the code if needed. (Take it easy on me please, total PHP virgin.)
Thanks,
Jason