fix a few things that i forgot to implement

This commit is contained in:
Carly Ho 2023-06-29 18:15:02 -05:00 committed by GitHub
parent bd7cd81b61
commit 73eedf46c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,8 @@ if (array_key_exists('give', $_GET)) {
$prevkudos = $db->query("select count(*) from kudos where workid={$work} and ipaddr={$ip};");
if ($exists > 0 && $prevkudos == 0) {
$db->query("insert into kudos (workid, ipaddr) values ({$work}, {$ip});");
$content = "Thanks for leaving kudos! You can now close this window."
require("./template.php");
}
} else if (array_key_exists('show', $_GET)) {
// We're showing the number of kudos
@ -46,7 +47,6 @@ if (array_key_exists('give', $_GET)) {
$content = file_get_contents("./form.php");
require("./template.php");
die(1);
} else if (array_key_exists('newwork', $_POST)) {
$work = filter_var($_POST['newwork'], FILTER_SANITIZE_STRING);
// check if the work exists already since we can't do duplicates
@ -71,5 +71,7 @@ if (array_key_exists('give', $_GET)) {
}
require("./template.php");
die(1);
}
// if we haven't closed connection yet, we're done now.
die(1);