You are here: Help with "POST" « PHP Programming Language « IT news, forums, messages
Help with "POST"

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация