From 3ac5490498b54400d762dd9b473e0f6814ce31b1 Mon Sep 17 00:00:00 2001 From: "Evan G." Date: Mon, 22 Apr 2024 08:44:13 -0500 Subject: [PATCH] Proper Alert Messaging Redirect --- guestbook/guestbook.css | 3 ++- guestbook/submit.php | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/guestbook/guestbook.css b/guestbook/guestbook.css index ae4b39b..5ddefa9 100644 --- a/guestbook/guestbook.css +++ b/guestbook/guestbook.css @@ -3,7 +3,8 @@ border: var(--line-width) solid; border-left-style: none; border-right-style: none; - border-top-style: none; + border-top-style: solid; + border-bottom-style: none; text-align: left; padding-bottom: 20px; padding-top: 10px; diff --git a/guestbook/submit.php b/guestbook/submit.php index 2f72818..069c4a0 100644 --- a/guestbook/submit.php +++ b/guestbook/submit.php @@ -14,18 +14,24 @@ $data = json_decode(file_get_contents('test.json'), true); # Add array_unshift($data , $savemsg); - +$newURL = "http://192.168.1.180:9890/guestbook/index.html"; # Check name and message if ($fname == "") { + + header('Refresh:2; url=' . $newURL ); echo "There is no name, Try again with a name"; exit(); } if ($fmsg == "") { + header('Refresh:2; url=' . $newURL ); echo "There is no message, Try again with a message"; exit(); } + + file_put_contents('test.json', json_encode($data, JSON_PRETTY_PRINT)); -echo $fmsg; - +header('Refresh:2; url=' . $newURL ); +echo "Your submisson has been added"; +exit();