Sun Oct 26, 2008 6:36 pm
<?php
$num_to_guess = 99;
$message = "";
if ( ! isset( $guess ) ){
$message = "Welcome to the guessing machine!";
}elseif( $guess > $num_to_guess ){
$message = "$guess is too big!";
}elseif( $guess < $num_to_guess ){
$message = "$guess is too small!";
}else {
$message = "Well done!";
}
?>
<html>
<head>
<title>A PHP number guessing script</title>
</head>
<body>
<h1>
<?php print $message ?>
</h1>
<form action="<?php print $PHP_SELF?>" method="POST">
Type your guess here: <input type="text" name="guess">
</form>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.