Ok there are a coupld of errors in your script. Here is a working version:
PHP Code:
<html>
<head>
<title>PHP Test!</title>
</head>
<body>
Try to guess my number! Good luck.<br /><br />
<form action="<?php $PHP_SELF ?>" method="post">
Print a number between 1 and 6:<input type="text" maxlength="1" length="10" name="number"><br />
<input type="submit" value="Let's see!"><br />
</form>
<?php
if (IsSet($number))
{
if ($number < 1 || $number > 6)
print("Your input was not a number from one to six. <BR>You input $number");
else
{
mt_srand((double) microtime() * 1000000);
$num = mt_rand(1,6);
if ($num == $number)
print("A WINNER! <a href=\"winner.php\">Click here to claim your prize!</a>");
else
print("Sorry, that's not that number");
}
}
?>
</body>
</html>
!is_integer($number) had to be removed as form input is passed as a string and therefor will always return false.
You forgot a quote at the end of this line:
print("A WINNER! <a href="winner.php">Click here to claim your prize!</a> );
You had also put quotes in the middle of the above string without backslashes in front. It should look like this:
print("A WINNER! <a href=\"winner.php\">Click here to claim your prize!</a>");
Regards,
Michael