Proper Alert Messaging Redirect

This commit is contained in:
Evan G. 2024-04-22 08:44:13 -05:00
parent e23387c7c0
commit 3ac5490498
Signed by: fbievan
GPG Key ID: 55FAB8CB6842F080
2 changed files with 11 additions and 4 deletions

View File

@ -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;

View File

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