<?
function slotnumber()
{
srand(time());
for ($i=0; $i < 3; $i++)
{
$random = (rand()%3);
$slot[] = $random;
}
print(“<td width=\”33%\”><center>$slot[0]</td>”);
print(“<td width=\”33%\”><center>$slot[1]</td>”);
print(“<td width=\”33%\”><center>$slot[2]</td>”);
if($slot[0] == $slot[1] && $slot[0] == $slot[2])
{
print(“</td></tr>Winner! — Hit refresh on your browser to play again”);
exit;
}
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>
<body>
<div align=”center”><center>
<table border=”1″ width=”50%”>
<tr>
<?
slotnumber();
?>
</td>
</tr>
<tr>
<td width=”100%” colspan=”3″ bgcolor=”#008080″><form method=”POST”
action=”example13.php3″><div align=”center”><center><p><input type=”submit” value=”Spin!”></p>
</center></div>
</form>
</td>
</tr>
</table>
</center></div>
</body>
</html>