You are here: Self calling form not working. « All PHP « IT news, forums, messages
Self calling form not working.

Posted by carlton on 07/17/06 20:14

I have tried to run this simple self calling script, but each time it
calls its self I always get the "Value of guess not set." message.
Any ideas on the problem?
Thanks in advance.
Carlton.
<?php
$num_to_guess=42;
$message="";
if (!isset($guess))
{
$message= " Welcome <BR>Value of guess not set. " ;
}
elseif ($guess > $num_to_guess )
{
$message="Number too BIG";
}
elseif ($guess < $num_to_guess )
{
$message="Number too SMALL";
}
else
{
$message="Guess CORRECT";
}
?>
<HTML>
<HEAD>
<TITLE>Number Guessing Script</TITLE>
</HEAD>
<BODY>
<H1>
Message is; &nbsp;<?php print $message ?>
</H1>
<?php
print "<BR>\$_SERVER[PHP_SELF] = ".$_SERVER["PHP_SELF"];
if(isset($guess))
{
print"<BR>guess value is ". $guess;
}
else
{
print "<BR>Value of guess NOT set.";
}
?>
<FORM ACTION="selfcall.php" METHOD="POST">
Type our guess here:<INPUT TYPE="TEXT" NAME="guess">
</FORM>
</body>
</html>

 

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

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