[php]<?php
$num1 = rand(1,20);
$num2 = rand(1,20);
$num3 = rand(1,20);
$num4 = rand(1,20);
$num5 = rand(1,20);
$pwrBall = rand(1,15);
$win1 = 5;
$win2 = 10;
$win3 = 4;
$win4 = 17;
$win5 = 1;
$winpwrBall = 15;
$pwrMatch;
$match1;
$match2;
$match3;
$match4;
$match5;
$match6;
if ($num1 == $win1)
{
$match1 = 1;
}
if ($num1 == $win2)
{
$match1 = 1;
}
if ($num1 == $win3)
{
$match1 = 1;
}
if ($num1 == $win4)
{
$match1 = 1;
}
if ($num1 == $win5)
{
$match1 = 1;
}
else {
$match1 = 0;
} //end match1
if ($num2 == $win1)
{
$match2 = 1;
}
if ($num2 == $win2)
{
$match2 = 1;
}
if ($num2 == $win3)
{
$match2 = 1;
}
if ($num2 == $win4)
{
$match2 = 1;
}
if ($num2 == $win5)
{
$match2 = 1;
}
else {
$match2 = 0;
} //end match2
if ($num3 == $win1)
{
$match3 = 1;
}
if ($num3 == $win2)
{
$match3 = 1;
}
if ($num3 == $win3)
{
$match3 = 1;
}
if ($num3 == $win4)
{
$match3 = 1;
}
if ($num3 == $win5)
{
$match3 = 1;
}
else {
$match3 = 0;
} //end match3
if ($num4 == $win1)
{
$match4 = 1;
}
if ($num4 == $win2)
{
$match4 = 1;
}
if ($num4 == $win3)
{
$match4 = 1;
}
if ($num4 == $win4)
{
$match4 = 1;
}
if ($num4 == $win5)
{
$match4 = 1;
}
else {
$match4 = 0;
} //end match4
if ($num5 == $win1)
{
$match5 = 1;
}
if ($num5 == $win2)
{
$match5 = 1;
}
if ($num5 == $win3)
{
$match5 = 1;
}
if ($num5 == $win4)
{
$match5 = 1;
}
if ($num5 == $win5)
{
$match5 = 1;
}
else {
$match5 = 0;
} //end match5
if ($pwrBall == $winpwrBall)
{
$match6 = 1;
}
else {
$match6 = 0;
} //end match6
if (($match1 + $match2 + $match3 + $match4 + $match5 == 0) && ($match6 == 1)){
print “You won $4.00!
”;
}
else if (($match1 + $match2 + $match3 + $match4 + $match5 == 1) && ($match6 == 1)){
print “You won $4.00!
”;
}
else if (($match1 + $match2 + $match3 + $match4 + $match5 == 2) && ($match6 == 1)){
print “You won $7.00!
”;
}
else if (($match1 + $match2 + $match3 + $match4 + $match5 == 3) && ($match6 == 0)){
print “You won $7.00!
”;
}
else if (($match1 + $match2 + $match3 + $match4 + $match5 == 3) && ($match6 == 1)){
print “You won $100.00!
”;
}
else if (($match1 + $match2 + $match3 + $match4 + $match5 == 4) && ($match6 == 0)){
print “You won $100.00!
”;
}
else if (($match1 + $match2 + $match3 + $match4 + $match5 == 4) && ($match6 == 1)){
print “You won $10,000!
”;
}
else if ($match1 == 1 && $match2 == 1 && $match3 == 1 && $match4 == 1 && $match5 == 1 && $match6 == 0){
print “You won $1,000,000!
”;
}
else if ($match1 == 1 && $match2 == 1 && $match3 == 1 && $match4 == 1 && $match5 == 1 && $match6 == 1){
print “You won 330 million Dollars!
”;
}
else {
echo "Sorry you did not win anything.<br />";
}
print "Your numbers are: $num1, $num2, $num3, $num4, $num5. Your PowerBall number is: $pwrBall <br />
This weeks numbers are: 5, 10, 4, 17, 1 with the PowerBall number of 15.<br />"
?>
[/php]