Confusing POST behavior -- doing it twice?



(posted previously on comp.lang.php but no response received. Cross-posted
in the dreamweaver forum)

I am confused about what goes on with method POST. Here is an overview of a
my code, sketching it out:

<?php
if (isset($_POST['Submit']) && $_POST['Submit']=="Submit") {
---Do a bunch of stuff---
if (isset($_SESSION['Error'])) unset($_SESSION['Error']);
if (strcmp($A, "any") {
// Verify that a Zip code is numeric and is five digits
If (!is_numeric($_POST($zip)) strlen($_POST($zip)) != 5) 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']; ?>
(Note: The form is type POST).

So here is the problem:
1 - When I start, there is no error message.
2 - I deliberately put in a bad zip code and have a value other than "any"
in the A control and click to submit it.
3 - Instead of going back to thisSite.php and displaying the error message,
it goes to anotherSite.php.
4 - If I then hit the back arrow on the browser, it displays with the error
message on thisSite.php

It seems that
1 - on the submit it goes through the logic and sets the error.
2 - 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


.



Relevant Pages

  • Re: Confusing POST behavior -- doing it twice?
    ... DXTrim ... > I am confused about what goes on with method POST. ... > in the A control and click to submit it. ... > 2 - It then must be going through a second time, ...
    (comp.lang.php)
  • Help with "POST"
    ... I am confused about what goes on with method POST. ... there is no error message. ... the A control and click submit it. ... It then must be going through a second time, but this time taking on the ...
    (comp.lang.php)
  • Re: NTSVC.OCX Help needed
    ... "When you use the Services snap-in to start a local service on a Microsoft ... The "cause" is stated as "This arbitrary time limit had been set with the ... error message and continue to check for the service to start. ... you must check the System event log for Service Control ...
    (microsoft.public.vb.general.discussion)
  • Microphone wont work
    ... Control Panel/Sounds and Audio Device/Voice/Testing sound Hardware. ... Windows error message "Windows cannot execute DpvSetup.exe, ... Sounds And Audio Devices icon (in the Sounds, Speech, And Audio Devices ... Now it's time to edit the Registry. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Debit Card Purchase recording
    ... >> End Sub ... > I have this in the After Update Event of the control in the form ... despite the error message you're getting. ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)