2021-11-15 11:47:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wishlist.php
|
|
|
|
*
|
|
|
|
* @author Jay Trees <github.jay@grandel.anonaddy.me>
|
|
|
|
*/
|
|
|
|
|
|
|
|
use wishthis\Page;
|
|
|
|
|
|
|
|
$page = new page(__FILE__, 'Home');
|
|
|
|
|
2021-11-15 11:59:55 +00:00
|
|
|
if (isset($_POST['name'])) {
|
|
|
|
$database->query('INSERT INTO `wishlists`
|
|
|
|
(`user`, `name`) VALUES
|
|
|
|
(' . $_SESSION['user']['id'] . ', "' . $_POST['name'] . '")
|
|
|
|
;');
|
2021-11-15 11:47:58 +00:00
|
|
|
|
|
|
|
$_SESSION['user'] = $user;
|
|
|
|
|
|
|
|
header('Location: ?page=home');
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
|
|
|
$page->header();
|
|
|
|
?>
|
|
|
|
<main>
|
|
|
|
<section>
|
|
|
|
<h1>Create a wishlist</h1>
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
<fieldset>
|
|
|
|
<label>Name</label>
|
2021-11-15 11:59:55 +00:00
|
|
|
<input type="text" name="name" placeholder="<?= getCurrentSeason() ?>" value="<?= getCurrentSeason() ?>" />
|
2021-11-15 11:47:58 +00:00
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<input type="submit" value="Create" />
|
|
|
|
</form>
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$page->footer();
|