View file highscore.php

File size: 1.35Kb
<?php 

	$file = "list.txt";
	$fd = fopen ($file, "r");
	$contents = fread ($fd, filesize ($file));
	fclose ($fd);
	$pieces = explode ("|", $contents);
	$count = count($pieces);

echo "<html>\r
<head>\r
<title>HiLower Game</title>\r
</head>\r
<body bgcolor=\"black\">\r

	<table class=\"sitemenu\" align=\"center\" bgcolor=\"gray\" bordercolor=\"silver\" border=\"1\" cellpadding=\"5\" cellspacing=\"0\">\r
	<tr align=\"center\">\r
	<td class=\"sitemenutopic\"><b>.: HIGHSCORE :.</b></td></tr>\r
	<tr><td>\r

		<table class=\"site\" align=\"center\" bordercolor=\"silver\" border=\"0\" cellpadding=\"0\">\r
		<tr><td align=\"center\"><b>SCORE</b></td><td>&nbsp;&nbsp;</td><td><b>NAME</b></td><td>&nbsp;&nbsp;</td><td align=\"center\"><b>DATE</b></td></tr>\r\n
";

$i = 0;
while( $i <= $count-3 )
{
	foreach ( $pieces as $line )
	{
	$line = trim($line);
	$linearray[] = $line;
	}

	echo "\t\t<tr><td align=\"center\">$linearray[$i]</td>"; $i = $i +1;
	echo "<td>&nbsp;&nbsp;</td>";
	echo "<td>$linearray[$i]</td>"; $i = $i +1;
	echo "<td>&nbsp;&nbsp;</td>";
	echo "<td>$linearray[$i]</td></tr>\n"; $i = $i +1;
}

echo "
		</table>\r

	</td></tr>\r
	<tr><td>Click <a href=\"index.php\">here</a> to play another game.<br>\r
		and   <a href=\"highscore.php\">here</a> for the highscore.\r
	</td></tr>\r
	</table>\r
</body>\r
</html>
";
?>