I have a login page that uses at the begining a session variable which is transmited to the secured pages.
The code looks like this:
session_start();
...checking the user and the pass in the MySQL DB
if (user & pass matches) {
session_register("loggedin");
$loggedin="yes";
header("Location: market.php");
}
The secured pages have the following code:
session_start();
if ($logout) {
session_destroy();
header("Location: mklogin.php");
}
if ($loggedin !="yes")
header("Location: mklogin.php");
OK. Now I have on a secured page a form and some validation rules for the fields. If the input doesn't match the rule, than a message is displayed and a link to "go back" to the form. Until I put the session validation, when I pressed the BACK button, the information in the form was still there. Now the form is blank if I "go back".
I used a javascript for taking the user back on the form page:
<a href="javascript:history.back(1)">Back</a>
Is there a way to keep the info in the form?
Any help is appreciated. Thanks.