rand function
Posted: Tue Dec 15, 2009 9:51 am
Hi i´ve been playing around with random function (rand()) and come up to this... here i get an error:
Notice: Undefined index: Random in C:\Program Files\wamp\www\mine\thomas\random.php on line 2
am i doing something wrong? cant figure it out.
Notice: Undefined index: Random in C:\Program Files\wamp\www\mine\thomas\random.php on line 2
Code: Select all
<?php
if ($_POST["Random"])//Kollar om knappen RANDOM använts.
{
$number = $number + 1;
if ($number < 10)
{
$rand = rand(0,1000);
if ($rand > 900)
{
echo $rand ."<br>";
echo "You Won" .rand(0,30000);
}
}
else
{
echo "You have played more then 10 times today";
}
}
?>
<input style='width:75;height:25;font-weight:bold' name="Random" type="submit" value="Random">