|
Posted by Shelly on 07/30/05 05:34
<?php
I am confused about what goes on with method POST. Here is my problem,
sketching it out:
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
Do a bunch of stuff
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (a certain form control, A, is not "any") {
Verify that a Zip code is numeric and is five digits
If not: then {
$_SESSION['Error'] = "an error description";
header("Location: thisSite.php:);
}
}
}
header("Location: anotherSite.php:);
?>
...... in the form description I have an
<?php if (isset(($_SESSION['Error'])) echo $_SESSION['Error']; ?>
The form is type POST.
So here it is:
When I start, there is no error message.
I deliberately put in a bad zip code and have a value other than "any" in
the A control and click submit it. It goes to anotherSite.php.
If I then hit the back arrow on the browser, it displays with the error
message.
It seems that on the submit it goes through the logic and sets the error.
It then must be going through a second time, but this time taking on the
default setting of "any" for control A and so bypass the logic on the zip
code and so goes to anotherSite.php.
Please help me here.
Shelly
Navigation:
[Reply to this message]
|