2008-10-22 12:38:31 +11:00
|
|
|
<script language="php">
|
|
|
|
$score = $_GET['score'];
|
|
|
|
$name = $_GET['name'];
|
|
|
|
$level = $_GET['level'];
|
2008-11-05 06:29:33 +11:00
|
|
|
$easymode = $_GET['easymode'];
|
2008-10-22 12:38:31 +11:00
|
|
|
|
|
|
|
sqlite_escape_string($score);
|
|
|
|
sqlite_escape_string($name);
|
|
|
|
sqlite_escape_string($level);
|
2008-11-05 19:01:22 +11:00
|
|
|
sqlite_escape_string($easymode);
|
2008-10-22 12:38:31 +11:00
|
|
|
|
|
|
|
# construct new entry
|
|
|
|
# $newentry = sprintf("%-8s%-12s%-12s%s",$score,$name,$rank,$text);
|
|
|
|
|
|
|
|
|
|
|
|
# open hiscore database
|
2008-11-05 19:06:04 +11:00
|
|
|
if ($easymode) {
|
2008-11-05 06:29:33 +11:00
|
|
|
$db = sqlite_open("hiscores.easy.db", 0666, $errorstr);
|
|
|
|
} else {
|
|
|
|
$db = sqlite_open("hiscores.db", 0666, $errorstr);
|
|
|
|
}
|
2008-10-22 12:38:31 +11:00
|
|
|
|
|
|
|
|
|
|
|
# insert entry
|
|
|
|
$insert = sprintf("insert into hiscores (score, name, level) values (%d, '%s', %d);",$score, $name, $level);
|
2008-11-05 06:29:33 +11:00
|
|
|
|
2008-10-23 06:45:35 +11:00
|
|
|
$rv = sqlite_exec($db, $insert);
|
2008-10-22 12:38:31 +11:00
|
|
|
sqlite_close($db);
|
|
|
|
|
2008-10-23 06:45:35 +11:00
|
|
|
echo "<html>";
|
|
|
|
if ($rv == FALSE) {
|
|
|
|
echo "error submitting hiscore\n";
|
|
|
|
} else {
|
|
|
|
echo "hiscore submitted.";
|
|
|
|
}
|
|
|
|
echo "</html>";
|
|
|
|
|
|
|
|
|
2008-10-22 12:38:31 +11:00
|
|
|
|
|
|
|
</script>
|