$value)
{
unset($value);
}
header("Location: ".$_SERVER['PHP_SELF']."");
}
if(isset($_POST['verzenden']) && ($_SERVER['REQUEST_METHOD'] == "POST"))
{
$aFout = array();
$naam = trim($_POST['naam']);
$email = trim($_POST['email']);
$onderwerp = trim($_POST['Sign up for the game']);
$bericht = trim($_POST['bericht']);
if($cfg['CAPTCHA'])
{
$code = $_POST['code'];
}
if(empty($naam) || (strlen($naam) < 3) || eregi("[<>]", $naam) )
{
$aFout[] = "Er is geen naam ingevuld.";
unset($naam);
$fout['text']['naam'] = TRUE;
$fout['input']['naam'] = TRUE;
}
if(empty($email))
{
$aFout[] = "Er is geen e-mail adres ingevuld.";
unset($email);
$fout['text']['email'] = TRUE;
$fout['input']['email'] = TRUE;
}
elseif(checkmail($email) == 0)
// Wanneer je PHP 5.2 > gebruikt
//elseif(!filter_var($email, FILTER_VALIDATE_EMAIL))
{
$aFout[] = "Er is geen correct e-mail adres ingevuld.";
unset($email);
$fout['text']['email'] = TRUE;
$fout['input']['email'] = TRUE;
}
if(empty($onderwerp))
{
$aFout[] = "Er is geen Sign up for the game ingevuld.";
unset($Sign up for the game);
$fout['text']['Sign up for the game'] = TRUE;
$fout['input']['Sign up for the game'] = TRUE;
}
if(empty($bericht))
{
$aFout[] = "Er is geen bericht ingevuld.";
unset($bericht);
$fout['text']['bericht'] = TRUE;
$fout['input']['bericht'] = TRUE;
}
if($cfg['CAPTCHA'])
{
if(strtoupper($code) != $_SESSION['captcha_code'])
{
$aFout[] = "Er is geen correcte code ingevuld.";
$fout['text']['code'] = TRUE;
$fout['input']['code'] = TRUE;
}
}
if(!$cfg['text'])
{
unset($fout['text']);
}
if(!$cfg['input'])
{
unset($fout['input']);
}
if(!empty( $aFout ))
{
$errors = '
';
foreach($aFout as $sFout)
{
$errors .= " ".$sFout." \n";
}
$errors .= "
";
}
else
{
$formulier = FALSE;
if($cfg['HTML'])
{
// Headers
$headers = "From: \"Contact Formulier\" <".$cfg['email'].">\r\n";
$headers .= "Reply-To: \"".$naam."\" <".$email.">\n";
$headers .= "Return-Path: Mail-Error <".$cfg['email'].">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$bericht = '
Naam: '.$naam.'
Email: '.$email.'
Bericht:
'.$bericht.'
--------------------------------------------------------------------------
Datum: '.date("d-m-Y @ H:i:s").'
IP: '.$_SERVER['REMOTE_ADDR'].'
Host: '.gethostbyaddr($_SERVER['REMOTE_ADDR']).'
';
}
else
{
$bericht_wrap = wordwrap ($bericht, 40, "\n", 1);
// Headers
$headers = "From: \"Contact Formulier\" <".$cfg['email'].">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset='iso-8859-1'\n";
// Bericht
$message = "Naam: ".$naam." \n";
$message .= "E-mail: ".$email." \n";
$message .= "Bericht:\n".$bericht_wrap." \n ";
$message .= " \n ";
$message .= "Datum: ".date("d-m-Y H:i:s")." \n";
$message .= "------------------------------------------------------- \n ";
$message .= "IP: ".$_SERVER['REMOTE_ADDR']." \n ";
$message .= "Host: ".gethostbyaddr($_SERVER['REMOTE_ADDR'])." \n ";
}
if(mail($cfg['email'], "[Contact] ".$onderwerp, $bericht, $headers))
{
if(isset($_POST['stuurkopie']))
{
$headers = "From: \"Contact Formulier\" <".$email.">\r\n";
$headers .= "Reply-To: \"".$naam."\" <".$email.">\n";
$headers .= "Return-Path: Mail-Error <".$email.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
mail($email, "[Contact] ".$onderwerp, $bericht, $headers);
}
unset($naam, $email, $Sign up for the game, $bericht);
setcookie("formulier", 1, time() + ( $cfg['spam'] * 60 ) );
echo "
Uw bericht is succesvol verzonden, er word zo snel mogelijk gereageerd.
Met vriendelijke groeten,
".$cfg['naam']."
";
}
else
{
echo "Er is een fout opgetreden bij het verzenden van de email";
}
header("refresh:3;url=".$cfg['url']."");
}
}
if($formulier)
{
?>
Contact Formulier door Thijs
Contact Formulier Versie 2
U kunt maar eens in de ".$cfg['spam']." minuten een e-mail versturen!
U wordt nu automatisch doorgestuurd.
";
header("refresh:3;url=".$cfg['url']."");
}
?>