Help with "POST"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shelly

    Help with "POST"

    <?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($_SESSIO N['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("Locatio n: thisSite.php:);
    }
    }
    }
    header("Locatio n: anotherSite.php :);
    ?>

    ...... in the form description I have an
    <?php if (isset(($_SESSI ON['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


Working...