if.php

Source of if.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>if.php</title>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
</head>
<body>
  <h1>Try to roll a six</h1>

  <p>
    <a href = "if.php">roll again</a>
  </p>
  
	<?php
	$roll = rand(1,6);
	
	print <<<HERE
  <p>
	  <img src = "images/die$roll.jpg"
	       alt = "$roll" />
  </p>
HERE;

  if ($roll == 6){
    print("<h1>Holy Guacamole! That's a six!</h1>\n");
  } // end if
	
	?>
</body>
</html>