Proper Alert Messaging Redirect
This commit is contained in:
parent
e23387c7c0
commit
3ac5490498
|
@ -3,7 +3,8 @@
|
||||||
border: var(--line-width) solid;
|
border: var(--line-width) solid;
|
||||||
border-left-style: none;
|
border-left-style: none;
|
||||||
border-right-style: none;
|
border-right-style: none;
|
||||||
border-top-style: none;
|
border-top-style: solid;
|
||||||
|
border-bottom-style: none;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
|
|
|
@ -14,18 +14,24 @@ $data = json_decode(file_get_contents('test.json'), true);
|
||||||
|
|
||||||
# Add
|
# Add
|
||||||
array_unshift($data , $savemsg);
|
array_unshift($data , $savemsg);
|
||||||
|
$newURL = "http://192.168.1.180:9890/guestbook/index.html";
|
||||||
# Check name and message
|
# Check name and message
|
||||||
if ($fname == "") {
|
if ($fname == "") {
|
||||||
|
|
||||||
|
header('Refresh:2; url=' . $newURL );
|
||||||
echo "There is no name, Try again with a name";
|
echo "There is no name, Try again with a name";
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
if ($fmsg == "") {
|
if ($fmsg == "") {
|
||||||
|
header('Refresh:2; url=' . $newURL );
|
||||||
echo "There is no message, Try again with a message";
|
echo "There is no message, Try again with a message";
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
file_put_contents('test.json', json_encode($data, JSON_PRETTY_PRINT));
|
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();
|
||||||
|
|
Loading…
Reference in New Issue