Can someone help me spam proof this PHP script? Also, when I use this script I get two emails, one empty and the other with the results.
<?php
$to = "voodoocastde@gmail.com";
$subject = "Registrierung auf voodooCAST.de";
$headers = "From: Form Mailer";
$forward = 0;
$location = "";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.
";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "
";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "
";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
header( 'Location: http://www.voodoocast.de/confirm.php' ) ;
}
?>
in your html form you can use <input type="email"></input>
and it will validate itself