<?php
/* Chris Hillman's Powerball Picker(TM)
   v. 0.1 - Feb 7, 2006
   chris@webboise.com
   requires >= PHP 4.2.0 */

/* Declare & set some variables
   - The min & max values determine the range for random number generation
     (in case they ever add more balls)
   - The qty values tell it how many balls to pick for ball type */

$main_min = 1;
$main_max = 55;
$powerball_min = 1;
$powerball_max = 42;
$main_qty = 5; // this will pick the specified number of balls

// Pick our main ball values
while (sizeof($main_vals) < $main_qty) {
   
$tmp_pick = rand($main_min, $main_max);
   if (!
in_array($tmp_pick, $main_vals)) {
      
$main_vals[] = $tmp_pick;
   }
}

// Sort array values for readability
asort ($main_vals);

// Pull the powerball number
$powerball_val = rand($powerball_min, $powerball_max);
?>
<!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>Chris' Powerball Picker</title>
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
</head>

<body>
<div align="center" class="style1">
  <h2>CHRIS' POWERBALL PICKER </h2>
  <p><img src="http://www.powerball.com/images/powerball/pb_logo_1.gif" alt="POWERBALL" width="330" height="75" longdesc="http://www.powerball.com/images/powerball/pb_logo_1.gif" /></p>
  <h3>YOUR NUMBERS: </h3>
  <h2><?php
foreach ($main_vals as $val) {
   echo
"$val ";
   }
?>&nbsp;&nbsp;<span style="color:#FF0000;"><?php echo $powerball_val; ?></span></h2><br><br>Refresh page (press F5) for new numbers.
</div>
</body>
</html>