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();