Yeah, i was pretty much bored so I decided to play a bit with the GET + rand function. Pretty fun .
Here's the demo: http://peekay.servegame.com/OnLine/guess.php
guess.php =
roll.php =PHP Code:<?php
echo "<h1>Let's play with this!</h1>";
echo "<h5>Fill out the form to play.</h5>";
echo "<br><br>";
echo "How to play? Bet a number from 1 to 100 to see your luck with the randomizer!";
echo "<form method='get' action='roll.php'>";
echo "What's your bet? <input type='text' name='bet' maxlength='3'><br>";
echo "<input type='submit' value='Roll!'></form>";
?>
Have fun lol :PPHP Code:<?php
$bet = $_GET['bet'];
$randomizer = rand(1, 100);
echo "<center>The dice is rolling omgz..!<br><br>";
echo "Your bet was $bet ...<br>";
echo ".. and the Dice rolled an <b>$randomizer</b>!<br><br>";
if($bet == $randomizer) {
echo "WOW YOU GOT IT RIGHT!! GRATS LUCKY BISH!";
} else {
echo "LOLWUT? You fail, seriously. <a href='guess.php'>Try again.</a>";
}
echo "<br><br><br><br>";
echo "Got a good score? Submit it now! <font size='1'>Coming soon...</font>";
?>



Reply With Quote![[Php] Dices](http://ragezone.com/hyper728.png)


