PDA

View Full Version : The Guessing Game!!! - Help!


Chris M
06-23-2002, 11:15 AM
Hey!

I need help please...

I am trying to make a random select function, that selects a random word every 24 hours...

I tried to make it so that it searched for a number, and that each number was assigned a value, but, even though it worked sort of, I dont know how to set it to every 24 hours, or why the error below happens :

Warning: Wrong parameter count for rand() in /usr/local/psa/home/vhosts/wootage.net/httpdocs/forums/guessword.php on line 2

Here is the php code I am using...

<?php
rand($num);
$num = "$num1, $num2, $num3, $num4, $num5";
$num1 = "testing";
$num2 = "test";
$num3 = "whoo";
$num4 = "whee";
$num5 = "dah";
$message= "";
$num_triesgw= ( isset( $num_triesgw ) ) ? ++$num_triesgw : 0;
if ( ! isset( $guess ) )
$message = "Welcome to The Guessing Game!!! (Simple Word Version)";
elseif ( $guess != $num )
$message = "Sorry...Incorrect Guess...Try again!";
else { //must be equal to
header( "Location: yey.html" );
exit;
}
$guess = (int)$guess;
?>
<html>
<head>
<title>The Guessing Game!!! (Simple Word Version)</title>
</head>
<body>
<h1><?php print $message ?></h1>
Guess Number: <?php print $num_triesgw?>
<form method="POST">
Type your guess here: <smallfont>(Remember - Press the Enter Key after guessing to submit your guess!!)</smallfont><br>
<input type="text" name="guess" value="<?php print $guess?>">
<input type="hidden" name="num_triesgw" value="<?php print $num_triesgw ?>">
</form>
</body>
</html>

Thanks:)

Satan