Categories
Randomizers

Flip the Coin

Simple presentation of php random function – http://flip-coin.goodplace.eu/

Flip coin

Page is refreshed after click on the Button. Picture of Coin is loaded according to results of random function.

How its made
Code:

...
<input type="button" value="Flip !" onClick="window.location.reload()">
...
<?php
if (rand(0,1) == 0) {
echo "<img src=\"1eurohead.jpg\" alt=\"Head\" title=\"Head\" border=\"0\" height=\"225\" width=\"225\">";
}
else {
echo "<img src=\"1eurotail.jpg\" alt=\"Tail\" title=\"Tail\" border=\"0\" height=\"225\" width=\"225\">";
}
?>
...

8.2.2017
Small update on site Flip the Coin.
Simple responsive template added.

Picture of boring usual 1 Euro coin replaced with very nice gold slovak 100 Euro collector coin picturing slavic earl Rastislav.

Coin head
Coin tail

Enjoy ! 🙂

Leave a Reply