From 1d85c53f907993e804703f3670f2bd59be396a66 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 18 Jun 2018 15:27:56 +0200 Subject: [PATCH] contact: code cleanup (mailform function) --- contact.php | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/contact.php b/contact.php index 1f0bad5..5c4c962 100644 --- a/contact.php +++ b/contact.php @@ -1,19 +1,25 @@ $v) { + foreach ($input as $k => $v) { $body .= "$k: $v\r\n"; } $sent = mail($rcpt, $subject, $body, $header); if (!$sent) - echo '

Helaas ging er iets mis bij het doorvoeren. Probeer het later nog eens.

'; - elseif ($source == 'bestelling') - echo '

Bedankt voor uw bestelling. U ontvangt z.s.m. de bevestiging van deze bestelling via uw opgegeven e-mailadres.

'; + return 'Helaas ging er iets mis bij het doorvoeren. Probeer het later nog eens.'; + + if ($source == 'bestelling') + print '

Bedankt voor uw bestelling. U ontvangt z.s.m. de bevestiging van deze bestelling via uw opgegeven e-mailadres.

'; else - echo '

Bedankt voor uw reactie!

'; + print '

Bedankt voor uw reactie!

'; + return; } - -- 2.30.0