As the the demo works fine but when I upload the game it does not work.

If I select 20 numbers or use the button to randomly choose them it just reloads the page and clears my choices.

Can someone help mr get this working and explain what is happening?

Thanks:

if needed:
http://www.web-user.info/games/keno/keno.txt
http://www.web-user.info/games/keno/keno.php



Code:
<CENTER>
	<P>
<?
//
// Copyright 2001 Xavier Media Group
// http://www.xaviermedia.com/php/
//
// If you need help or have suggestions, please visit
// http://forum.xaviermedia.com/ or
// http://www.xaviermedia.com/php/keno.phtml
//

$keno_numbers = array (
	"0" => "",
	"1" => "",
	"2" => "",
	"3" => "",
	"4" => "",
	"5" => "",
	"6" => "",
	"7" => "",
	"8" => "",
	"9" => "",
	"10" => "",
	"11" => "",
	"12" => "",
	"13" => "",
	"14" => "",
	"15" => "",
	"16" => "",
	"17" => "",
	"18" => "",
	"19" => "",
	"20" => "");

if ($_REQUEST[resetall] != "")
{
	$player_numbers = array ();
	$action = "";
}
elseif ($_REQUEST[playrandom] != "")
{
	$player_numbers = array ();
	$i = 0;
	while ($i < 20)
	{
		$temp = rand(1,80);
		if (!in_array($temp,$player_numbers))
		{
			$player_numbers[$i] = $temp;
			$i++;
		}
	} 
}
else
{
	$player_numbers = array (
		"0" => "$n1",
		"1" => "$n2",
		"2" => "$n3",
		"3" => "$n4",
		"4" => "$n5",
		"5" => "$n6",
		"6" => "$n7",
		"7" => "$n8",
		"8" => "$n9",
		"9" => "$n10",
		"10" => "$n11",
		"11" => "$n12",
		"12" => "$n13",
		"13" => "$n14",
		"14" => "$n15",
		"15" => "$n16",
		"16" => "$n17",
		"17" => "$n18",
		"18" => "$n19",
		"19" => "$n20");
}

if ($action == "play")
{
	$i = 0;
	while ($i < 20)
	{
		$temp = rand(1,80);
		if (!in_array($temp,$keno_numbers))
		{
			$keno_numbers[$i] = $temp;
			$i++;
		}
	} 
	sort($keno_numbers);
	sort($player_numbers);
}
$i = 0;
$points = 0;
while ($i < 21)
{
	if (in_array($keno_numbers[$i],$player_numbers))
		$points++;
	$i++;
}
?>

<STYLE>

.keno_blueline {
  background-color: #E3E4F7;
}
.keno_pickednumber {
  background-color: #F5F5C2;
}
.keno_winningandpickednumber {
  background-color: #C1F5C2;
}
.keno_winningnumber {
  background-color: #ECBCBC;
}
.keno_notpickednumber {

}
.keno_winningnumber, .keno_pickednumber, .keno_blueline, .keno_notpickednumber, .keno_winningandpickednumber { font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; }

</STYLE>

<script type="text/javascript">
<!--
function selectkeno(v)
{
	if (document.getElementById('picked' + v).value == 0)
	{
		if (document.kenoform.n20.value > 0)
		{
			document.getElementById('keno' + document.kenoform.n20.value).className = document.getElementById('oldclass' + document.kenoform.n20.value).value;
			document.getElementById('picked' + document.kenoform.n20.value).value = 0;
		}
		document.kenoform.n20.value = document.kenoform.n19.value
		document.kenoform.n19.value = document.kenoform.n18.value
		document.kenoform.n18.value = document.kenoform.n17.value
		document.kenoform.n17.value = document.kenoform.n16.value
		document.kenoform.n16.value = document.kenoform.n15.value
		document.kenoform.n15.value = document.kenoform.n14.value
		document.kenoform.n14.value = document.kenoform.n13.value
		document.kenoform.n13.value = document.kenoform.n12.value
		document.kenoform.n12.value = document.kenoform.n11.value
		document.kenoform.n11.value = document.kenoform.n10.value
		document.kenoform.n10.value = document.kenoform.n9.value
		document.kenoform.n9.value = document.kenoform.n8.value
		document.kenoform.n8.value = document.kenoform.n7.value
		document.kenoform.n7.value = document.kenoform.n6.value
		document.kenoform.n6.value = document.kenoform.n5.value
		document.kenoform.n5.value = document.kenoform.n4.value
		document.kenoform.n4.value = document.kenoform.n3.value
		document.kenoform.n3.value = document.kenoform.n2.value
		document.kenoform.n2.value = document.kenoform.n1.value
		document.kenoform.n1.value = v
		document.getElementById('keno' + v).className = 'keno_pickednumber';
		document.getElementById('picked' + v).value = 1;
	}
}


//-->
</script>

<?
echo "<A NAME=keno></A><FORM METHOD=post ACTION=\"$PHP_SELF?page=keno&". time(). "#keno\" NAME=kenoform>\n";
echo "<P>Click on the numbers you would like to pick. You may only select 20 numbers.</P>\n";
echo "<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0>";
$n = 1;
for ($i = 0; $i < 8; $i++)
{
	if ($i % 2 == 1)
		echo "\n  <TR CLASS=keno_blueline>";
	else
		echo "\n  <TR>";

	for ($j = 0; $j < 10; $j++)
	{
		$picked = 0;
		if (in_array ($n, $player_numbers) && in_array($n, $keno_numbers))
		{
			$picked = 1;
			$class = 'keno_winningandpickednumber';
			$oldclass = 'keno_winningnumber';
		}
		else if (in_array ($n, $player_numbers))
		{
			$picked = 1;
			$class = 'keno_pickednumber';
			$oldclass = 'keno_notpickednumber';
		}
		else if (in_array($n, $keno_numbers))
		{
			$class = 'keno_winningnumber';
			$oldclass = 'keno_winningnumber';
		}
		else
		{
			$class = 'keno_notpickednumber';
			$oldclass = 'keno_notpickednumber';
		}
		echo "    <TD ALIGN=center CLASS=". $class ." ID=\"keno$n\" onClick=\"javascript:selectkeno($n);\"><INPUT TYPE=hidden NAME=pickednumber[$n] VALUE=\"$picked\" ID=picked$n><INPUT TYPE=hidden NAME=oldclass[$n] VALUE=\"$oldclass\" ID=oldclass$n> &nbsp; <B>$n</B> &nbsp; </TD>\n";
		$n++;
	}
	echo "  </TR>\n";
}
echo " <TR><TD CLASS=keno_pickednumber>&nbsp;</TD><TD COLSPAN=9 CLASS=keno_notpickednumber>Number you picked</TD></TR>\n";
echo " <TR><TD CLASS=keno_winningnumber>&nbsp;</TD><TD COLSPAN=9 CLASS=keno_notpickednumber>Winning number you didn't have</TD></TR>\n";
echo " <TR><TD CLASS=keno_winningandpickednumber>&nbsp;</TD><TD COLSPAN=9 CLASS=keno_notpickednumber>Winning number you <B>did</B> pick!</TD></TR>\n";


echo "</TABLE>";

if ($action == "play")
{
	$again = " again!";
	echo "<B>The winning numbers are:</B><BR>";
	$w = 0;
	while ($w < 21)
	{
		echo " &nbsp; $keno_numbers[$w]";
		$w++;
		if ($w == 10)
			echo "<BR>";
	}
	echo "<BR><B>and you selected:</B><BR>";
	$w = 0;
	while ($w < 21)
	{
		echo " &nbsp; $player_numbers[$w]";
		$w++;
		if ($w == 10)
			echo "<BR>";
	}
	echo "<P><B>You have $points winning numbers!</B></P>";
}

echo "<INPUT TYPE=hidden NAME=action VALUE=\"play\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n1 VALUE=\"". ($player_numbers[0] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n2 VALUE=\"". ($player_numbers[1] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n3 VALUE=\"". ($player_numbers[2] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n4 VALUE=\"". ($player_numbers[3] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n5 VALUE=\"". ($player_numbers[4] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n6 VALUE=\"". ($player_numbers[5] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n7 VALUE=\"". ($player_numbers[6] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n8 VALUE=\"". ($player_numbers[7] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n9 VALUE=\"". ($player_numbers[8] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n10 VALUE=\"". ($player_numbers[9] * 1) ."\"><BR>";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n11 VALUE=\"". ($player_numbers[10] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n12 VALUE=\"". ($player_numbers[11] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n13 VALUE=\"". ($player_numbers[12] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n14 VALUE=\"". ($player_numbers[13] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n15 VALUE=\"". ($player_numbers[14] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n16 VALUE=\"". ($player_numbers[15] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n17 VALUE=\"". ($player_numbers[16] * 1) ."\"> ";
echo "<INPUT TYPE=hidden text SIZE=2 MAXLENGTH=2 NAME=n18 VALUE=\"". ($player_numbers[17] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n19 VALUE=\"". ($player_numbers[18] * 1) ."\"> ";
echo "<INPUT TYPE=hidden SIZE=2 MAXLENGTH=2 NAME=n20 VALUE=\"". ($player_numbers[19] * 1) ."\"><BR>";
echo "<INPUT TYPE=submit NAME=play VALUE=\"Play KENO$again\"> <INPUT TYPE=submit NAME=playrandom VALUE=\"Pick 20 random numbers\"> <INPUT TYPE=submit NAME=resetall VALUE=\"Re-start\"></FORM>";
echo "<FONT FACE=\"verdana, arial, helvetica\" SIZE=1>This <A HREF=\"http://www.xaviermedia.com/php/keno.phtml\">keno game</A> is a free script from <A HREF=\"http://www.xaviermedia.com/\">Xavier Media</A>&trade;</FONT>";
?>
</P>
</CENTER>