diff --git a/public/contact.php b/public/contact.php index b01611e..074fd1b 100644 --- a/public/contact.php +++ b/public/contact.php @@ -7,15 +7,30 @@ require __DIR__ . "/../lib/requiredpublic.php"; -if (empty($_POST['name']) || empty($_POST['message']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { +function output_card($content) { ?>
Whoops! You didn't fill out the contact form properly. Go back and try again.
+ +Go back and try again.
+END; + output_card($content); + die(); } $database->insert("messages", [ @@ -26,4 +41,10 @@ $database->insert("messages", [ "date" => date("Y-m-d H:i:s") ]); -header('Location: ./'); +$content = <<Your message has been sent!
+Continue +END; + +output_card($content); \ No newline at end of file