Easy hiscores changes

This commit is contained in:
Rob Pearce 2008-11-04 19:29:33 +00:00
parent 6db20bd0db
commit 43b27a532e
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
$score = $_GET['score'];
$name = $_GET['name'];
$level = $_GET['level'];
$easymode = $_GET['easymode'];
sqlite_escape_string($score);
sqlite_escape_string($name);
@ -12,11 +13,16 @@ sqlite_escape_string($level);
# open hiscore database
$db = sqlite_open("hiscores.db", 0666, $errorstr);
if ($easymode == 1) {
$db = sqlite_open("hiscores.easy.db", 0666, $errorstr);
} else {
$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);