🎨 Don't use header() to redirect to /login

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
2020-08-04 18:29:23 +01:00
parent d464fef3a8
commit b68f299021
5 changed files with 118 additions and 144 deletions

View File

@@ -3,10 +3,6 @@
require_once __DIR__ . "/../includes/prereqs.php";
require_once __DIR__ . "/../includes/header.php";
if (!is_signed_in()) {
header('Location: /login');
}
// If form submitted, save to database
if($_SERVER['REQUEST_METHOD'] == 'POST') {
try {
@@ -69,7 +65,7 @@
<section>
<div class="card mx-auto" style="width: 50%;">
<form action="/new" method="post" enctype="multipart/form-data">
<form style="padding: 2%" action="/new" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="title">Title: </label>
<input type="text" class="form-control" id="title">