diff --git a/css/main.css b/css/main.css index 83942f1..e7fb1d2 100644 --- a/css/main.css +++ b/css/main.css @@ -13,6 +13,12 @@ body { div.main { } +div.error { + border: 1px solid #ef5350; + background-color: #ff867c; + padding: 5px; +} + /* stuff for input's like the login and post forms */ form.input-form { } diff --git a/register.php b/register.php index 0e7a270..d6e2793 100644 --- a/register.php +++ b/register.php @@ -7,13 +7,29 @@ # # # - # - # - # - # - # - # - # +//TODO: email / invite registration + // if a registration was submitted if($_SERVER['REQUEST_METHOD'] == 'POST') { + # function to handle failed registrations + function failed_register($msg) { + header("Location: /register.php?login_failed=$msg"); + exit(); + } + + // Assign the form contents to variables + $username = $_POST['user'] ?? ''; + $password = $_POST['pass'] ?? ''; + + // Check for empty or blank fields + if ($username == '') failed_register("invalid username"); + if ($password == '') failed_register("invalid password"); + } $path = $_SERVER['DOCUMENT_ROOT']; -include($path . '/core/header.php'); +require($path . '/core/header.php'); ?>

register

-
+ @@ -41,6 +57,7 @@ include($path . '/core/header.php'); +
username:
+
+ +
"; + echo "
"; + echo $_GET['login_failed']; + echo "
"; +} +?>
-