I'm creating my own lottery feature for my online game, which uses in-game money. I decided to create my own function to compare the numbers of each ticket. Before I started creating the mod, I did some testing to see if my pseudocode function would work. When I go onto my test page, I get this error: Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.
I've Googled it, and it says that it's a Google Chrome error and that I should restart my browser and so on, which I did. Nothing worked. I've yet to try it in another browser yet.....
My code is below:
<?php
include_once(DIRNAME(__FILE__) ."/globals.php");
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
function checkResult($numbers, $winNums, $key, $wins) {
if($key >= 7 && $wins >= 7) {
print "Break out <br />";
return $correct;
break;
}
else {
$nums = unserialize($numbers);
$winning = unserialize($winNums);
$p = $nums[$key];
$n = $winning[$wins];
if($n != $p && $n > $p) {
print "Increment \$key <br />";
$key++;
checkResult($numbers, $winNums, $key, $wins);
}
elseif($n != $p && $n < $p) {
print "Increment \$wins <br />";
$wins++;
checkResult($numbers, $winNums, $key, $wins);
}
elseif($n === $p) {
print "Matching! <br />";
$correct++;
$key++;
$wins++;
checkResult($numbers, $winNums, $key, $wins);
}
}
}
$yourNumbers = array(15,20,42,37,4,;
$winNumbers = array(17,28,20,4,15,39);
$sortYourNumbers = sort($yourNumbers);
$sortWinNumbers = sort($winNumbers);
print_r($yourNumbers);
print "<br />";
print_r($sortYourNumbers);
print "<hr />";
print_r($winNumbers);
print "<br />";
print_r($sortWinNumbers);
$yrs = serialize($yourNumbers);
$wns = serialize($winNumbers);
$correct = 0;
print "<br />";
print $yrs ."<br />";
print $wns;
checkResult($yrs, $wns, 0, 0);
$h->endpage();
?>
Could someone please point out to me why this is causing the unknown error? I've tried other pages on my website, they all work perfectly.
Any help will be appreciated.