diff options
author | Mateja <mail@matejamaric.com> | 2020-10-04 00:16:49 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-10-04 00:16:49 +0200 |
commit | a3094caeb564821870870d57efb4a4fc3fd659e7 (patch) | |
tree | 9399de7d6fd48900d1d01573a81a286aa2fdfa74 /handle-reservation.php | |
parent | 1e44886d6f53d5bb9621211810fdea247f7fbd71 (diff) | |
download | old-php-yota-a3094caeb564821870870d57efb4a4fc3fd659e7.tar.gz old-php-yota-a3094caeb564821870870d57efb4a4fc3fd659e7.zip |
A whole lot of shaking going on...
Diffstat (limited to 'handle-reservation.php')
-rw-r--r-- | handle-reservation.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/handle-reservation.php b/handle-reservation.php index c61ed3c..bed1949 100644 --- a/handle-reservation.php +++ b/handle-reservation.php @@ -59,7 +59,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // Error handling if ($is_something_empty) { - echo "<p class=\"mid\"><strong>All fields must be filed!</strong></p>"; + $_SESSION["msg"] = "All fields must be filed!"; } else { // Send to DB @@ -79,9 +79,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $stmt->bindParam(':operatorEmail', $operatorEmail); $stmt->bindParam(':operatorPhone', $operatorPhone); $stmt->execute(); - echo "<p class=\"mid\">Data inserted.</p>"; + $_SESSION["msg"] = "Data inserted."; } catch (PDOException $e) { - echo "<p class=\"mid\">Error!: " . $e->getMessage() . "</p>"; + $_SESSION["msg"] = "Error!: " . $e->getMessage(); } } } @@ -92,3 +92,5 @@ function clear_input($data) { $data = htmlspecialchars($data); return $data; } + +header("Location: reservation.php"); |