X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/451864cbd7039109234e8923df015e8bc1529fd4..ce951ad9579fd96a7ba185f6d7cbd99bd37b9ec4:/contact.php diff --git a/contact.php b/contact.php index 94d8ebe..7ffa409 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 +46,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@$domain"; $header = "From: $reply"; foreach (array( @@ -40,7 +59,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 +79,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!

'; }