wishthis/includes/pages/wishlist-create.php

50 lines
1.1 KiB
PHP
Raw Normal View History

2021-11-15 12:09:00 +00:00
<?php
/**
* wishlist.php
*
* @author Jay Trees <github.jay@grandel.anonaddy.me>
*/
use wishthis\Page;
2021-11-15 13:52:11 +00:00
$page = new page(__FILE__, 'Create a wishlist');
2021-11-15 12:09:00 +00:00
if (isset($_POST['name'])) {
$database->query('INSERT INTO `wishlists`
(`user`, `name`) VALUES
(' . $_SESSION['user']['id'] . ', "' . $_POST['name'] . '")
;');
$_SESSION['user'] = $user;
header('Location: ?page=home');
die();
}
$page->header();
2022-01-14 07:43:48 +00:00
$page->navigation();
2021-11-15 12:09:00 +00:00
?>
<main>
2022-01-14 07:43:48 +00:00
<div class="ui container">
<div class="ui segment">
<h1 class="ui header">Create a wishlist</h1>
<form class="ui form" method="post">
<div class="field">
<label>Name</label>
2022-01-14 07:47:08 +00:00
<input type="text"
name="name"
placeholder="<?= getCurrentSeason() ?>"
value="<?= getCurrentSeason() ?>"
/>
2022-01-14 07:43:48 +00:00
</div>
<input class="ui primary button" type="submit" value="Create" />
</form>
</div>
</div>
2021-11-15 12:09:00 +00:00
</main>
<?php
$page->footer();