ratcatcher/website/hiscores/submitscore.php

34 lines
673 B
PHP
Raw Normal View History

<script language="php">
$score = $_GET['score'];
$name = $_GET['name'];
$level = $_GET['level'];
sqlite_escape_string($score);
sqlite_escape_string($name);
sqlite_escape_string($level);
# construct new entry
# $newentry = sprintf("%-8s%-12s%-12s%s",$score,$name,$rank,$text);
# open hiscore database
$db = sqlite_open("hiscores.db", 0666, $errorstr);
# insert entry
$insert = sprintf("insert into hiscores (score, name, level) values (%d, '%s', %d);",$score, $name, $level);
2008-10-23 06:45:35 +11:00
$rv = sqlite_exec($db, $insert);
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>";
</script>