I would appreciate any help with the following problem.
I have several different htm pages with (simalar) forms that are
processed by the same
PHP script. If there is data missing on the form, the script displays
an error page (using the header() function) and informs the user to
press
the browser's "Back" button. The problem is that when the user goes
back
to the form's htm page, all the fields are blank. I would like all
the fields to
contain the data the user previously entered, so that only the
missing data
needs to be entered.
This happens sometimes but not always.
The pseudocode is something like this:
MyWebForm.htm (contains the html form) and links to:
ProcessWebForm. php:
<form name="reservati on" action="Process WebForm.php" method="POST">
--> Inside ProcessWebForm. php:
//-------------------------------------
// Gets the information from the forms
if ($_POST['firstname']) {
$required_first = $_POST['firstname'];
}
else {
header("Locatio n: nofirstname.htm l");
exit;
//--------------------------------------
--> Inside nofirstname.htm l:
<html>
<head><title>Mi ssing Reservation Information, NAME</title></head>
<body>
Sorry, you have omitted your First Name. Please click your computer's
Back
button to return to the reservation form and enter your first
name.</font></p>
</body>
</html>
I have several different htm pages with (simalar) forms that are
processed by the same
PHP script. If there is data missing on the form, the script displays
an error page (using the header() function) and informs the user to
press
the browser's "Back" button. The problem is that when the user goes
back
to the form's htm page, all the fields are blank. I would like all
the fields to
contain the data the user previously entered, so that only the
missing data
needs to be entered.
This happens sometimes but not always.
The pseudocode is something like this:
MyWebForm.htm (contains the html form) and links to:
ProcessWebForm. php:
<form name="reservati on" action="Process WebForm.php" method="POST">
--> Inside ProcessWebForm. php:
//-------------------------------------
// Gets the information from the forms
if ($_POST['firstname']) {
$required_first = $_POST['firstname'];
}
else {
header("Locatio n: nofirstname.htm l");
exit;
//--------------------------------------
--> Inside nofirstname.htm l:
<html>
<head><title>Mi ssing Reservation Information, NAME</title></head>
<body>
Sorry, you have omitted your First Name. Please click your computer's
Back
button to return to the reservation form and enter your first
name.</font></p>
</body>
</html>
Comment