Rolling a dice in PHP

<?php
if(isset($_POST['roll']))
{
    echo 'You rolled a '.rand(1, 6).'<br/><br/>';
}
?>

<form action="index.php" method="post">
    <input type="submit" name="roll" value="Roll Dice"/>
</form>

Comments

Popular posts from this blog

Timus 1209. 1, 10, 100, 1000... accepted solution in C

Timus Problem 1086. Cryptography Accepted Solution in C

Timus 1083. Factorials!!! Accepted Solution in C