You are here: Newbie: How do I test for "reposting" a form to itself? « PHP Programming Language « IT news, forums, messages
Newbie: How do I test for "reposting" a form to itself?

Posted by Larry Woods on 07/29/05 15:02

I have the following htm file "sendmail.php":

<html>
<head>
</head>
<?php
if ($HTTP_POST_VARS["postback"]=="y") {
................blah, blah.
}
?>
<body bgcolor="white">

<form action="sendemail.php" method="post">
.................blah, blah.
<input type="hidden" name="postback" value="y">
</form>
</body>
</html>

When I execute this script I get the following ,

Notice: Undefined index: postback in C:\Inetpub\wwwroot\PHP\sendemail.php on
line 5

which is referring to the "If" statement. I "assume" this error/warning is
because the parser executes the 'if' statement on the first time through and
the form varialbles are not defined at this time.

How do I test for a "postback" situation? (Yes, I know that I could serve
up another page instead of the SAME page, but this is fairly common
practice, so there MUST be a way to do it....right?)

TIA,

Larry Woods

 

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

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