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>
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
Post a Comment