Thursday, April 6, 2017

Randomization in PHP


<?php

if(isset($_POST['roll'])){
  $rand = rand(000, 999);
  echo 'You roll a '.$rand;

}

?>

<form action="rand.php" method="POST">
<input type="submit" name="roll" value="Roll a Dice">
</form>

No comments:

Post a Comment