X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/451864cbd7039109234e8923df015e8bc1529fd4..1f8560a20d5d1aa8886688bd7553b8a8fd704fff:/contact.php diff --git a/contact.php b/contact.php index 94d8ebe..9d0b1bc 100644 --- a/contact.php +++ b/contact.php @@ -1,6 +1,7 @@ '; + break; + default: if (empty($input['email']) or !preg_match('/.+@.+\..+/', $input['email'])) { return 'Een geldig e-mailadres is verplicht zodat we antwoord kunnen geven.'; } @@ -25,10 +45,8 @@ if ($source != 'bbq') { } } - $rcpt = 'info@'.$_SERVER['HTTP_HOST']; - $subject = "Formulier {$_SERVER['HTTP_HOST']}: $source"; $reply = preg_match('/\A\w+@\w+\.[a-z]+\z/', @$input['email']) - ? $input['email'] : $rcpt; + ? $input['email'] : 'noreply@'.$_SERVER['HTTP_HOST']; $header = "From: $reply"; foreach (array( @@ -40,7 +58,9 @@ if ($source != 'bbq') { } $origin = $_SERVER['REMOTE_ADDR']; - $origin .= sprintf(' (%s)', gethostbyaddr($origin)); + if ($resolved = @gethostbyaddr($origin) and $resolved !== $origin) { + $origin .= sprintf(' (%s)', gethostbyaddr($origin)); + } $body = "Ingevuld vanaf $origin:\r\n\r\n"; foreach ($input as $k => $v) { @@ -58,6 +78,9 @@ if ($source != 'bbq') { case 'bbq': print "

Bedankt voor je deelname. Tot ziens!

"; break; + case 'melding': + print "

Bedankt voor de melding. Na goedkeuring zal het hier geplaatst worden.

"; + break; default: print '

Bedankt voor uw reactie!

'; }