It now won't require there to be at least one entry in the motd table.
I also tidied up the motd class
This commit is contained in:
2018-08-06 23:26:29 +02:00
parent 29ac0ece7e
commit 32cc4ec27f
5 changed files with 40 additions and 12 deletions

View File

@@ -25,15 +25,11 @@ if(!$userManager->isAdmin($uname)){
exit();
}
$query = 'UPDATE motd SET title=:title, content=:content';
$statement = $pdo->prepare($query);
$statement->bindParam(':title', $_POST['title'], PDO::PARAM_STR);
$statement->bindParam(':content', $_POST['content'], PDO::PARAM_STR);
$statement->execute();
$motdfetcher = new \pvv\side\MOTD($pdo);
$motdfetcher->setMOTD($_POST['title'], $_POST['content']);
header('Location: .');
?>
<a href=".">Om du ikke ble automatisk omdirigert tilbake klikk her</a>
<a href=".">Om du ikke ble automatisk omdirigert tilbake klikk her</a>