34 lines
673 B
PHP
34 lines
673 B
PHP
|
<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);
|
||
|
$rv = sqlite_exec($db, $insert);
|
||
|
sqlite_close($db);
|
||
|
|
||
|
echo "<html>";
|
||
|
if ($rv == FALSE) {
|
||
|
echo "error submitting hiscore\n";
|
||
|
} else {
|
||
|
echo "hiscore submitted.";
|
||
|
}
|
||
|
echo "</html>";
|
||
|
|
||
|
|
||
|
|
||
|
</script>
|