From f01f3478c4992d9ffba7765254c0569af20cabe6 Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Sat, 16 Mar 2019 04:43:32 -0400 Subject: controllers/contact: Let the view use alternate variables Set them to null when successful on the view --- controllers/contact.controller.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'controllers') diff --git a/controllers/contact.controller.php b/controllers/contact.controller.php index 0f988f3..cdba14e 100644 --- a/controllers/contact.controller.php +++ b/controllers/contact.controller.php @@ -7,9 +7,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $submit = new Form(); - $submit->name = $_POST['26471'] ?? null; - $submit->email = $_POST['26472'] ?? null; - $submit->message = $_POST['26473'] ?? null; + $submit->name = $name = $_POST['26471'] ?? null; + $submit->email = $email = $_POST['26472'] ?? null; + $submit->message = $message = $_POST['26473'] ?? null; $spam = $_POST['agree'] ?? false; @@ -36,6 +36,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $formSuccess = true; + $name = null; + $email = null; + $message = null; + include '../views/contact.view.php'; fastcgi_finish_request(); -- cgit v1.2.3