Help with "POST"
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Help with "POST"

From: Shelly <sheldonlg.news@asap-consult.com>
Date: Sat Jul 30 2005 - 04:34:36 CEST

<?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
Received on Tue Oct 18 02:06:13 2005