<?php
// Config Gedeelte
$cfg['url'] = "http:/www.mijnwebsite.be/";// Site waarnaar je terug gaat als je een bericht hebt achtergelaten
$cfg['naam'] = "karel"; // Webmaster naam
$cfg['email'] = "info@mijnwebsite.be"; // Webmaster E-mail
$cfg['spam'] = 1; // Anti Spam Tijd in Minuten ( Voer "0" om de Spam Beveiliging uit te zetten )
$cfg['text'] = TRUE; // Bij Fout Text Rood maken ( TRUE voor aan, FALSE voor uit )
$cfg['input'] = TRUE; // Bij Fout Border om Vakje Rood maken ( TRUE voor aan, FALSE voor uit )
$cfg['HTML'] = TRUE; // Een HTML email ( TRUE voor aan, FALSE voor uit )
$cfg['CAPTCHA'] = TRUE; // CAPTCHA ( TRUE voor aan, FALSE voor uit )
// Hieronder niks meer veranderen
// E-mail Checker / Validator
function checkmail($email)
{
if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$", $email)) {
return TRUE;
}
return FALSE;
}
$formulier = TRUE;
if(!isset($_COOKIE['formulier'])) {
if(isset($_POST['wis']) && ($_SERVER['REQUEST_METHOD'] == "POST")) {
foreach($_POST as $key => $value)
{
}
header("Location: ".$_SERVER['PHP_SELF'].""); }
if(isset($_POST['verzenden']) && ($_SERVER['REQUEST_METHOD'] == "POST")) {
$bedrijf = trim($_POST['bedrijf']); $naam = trim($_POST['naam']); $adres = trim($_POST['adres']); $postcode = trim($_POST['postcode']); $gemeente = trim($_POST['gemeente']); $land = trim($_POST['land']); $tel = trim($_POST['tel']); $tel2 = trim($_POST['tel2']); $fax = trim($_POST['fax']); $email = trim($_POST['email']); $deadline1 = trim($_POST['deadline1']); $deadline2 = trim($_POST['deadline2']); $deadline3 = trim($_POST['deadline3']); $deadline_geen = trim($_POST['deadline_geen']); $deadline_andere = trim($_POST['deadline_andere']); $deadline_andere2 = trim($_POST['deadline_andere2']);
if($cfg['CAPTCHA'])
{
$code = $_POST['code'];
}
{
$aFout[] = "Er is geen naam ingevuld.";
$fout['text']['naam'] = TRUE;
$fout['input']['naam'] = TRUE;
}
{
$aFout[] = "Er is geen e-mail adres ingevuld.";
$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.";
$fout['text']['email'] = TRUE;
$fout['input']['email'] = 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'])
{
}
if(!$cfg['input'])
{
}
{
$errors = '
<div id="errors">
<ul>';
foreach($aFout as $sFout)
{
$errors .= " <li>".$sFout."</li>\n";
}
$errors .= "</ul>
</div>";
}
else
{
$formulier = FALSE;
if($cfg['HTML'])
{
// Headers
$headers = "From: \"mijnwebsite\" <".$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 = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<body>
<br />
<b>Bedrijf:</b> '.$bedrijf.'<br />
<b>Naam:</b> '.$naam.'<br />
<b>Adres:</b> '.$adres.'<br />
<b>Postcode:</b> '.$postcode.'<br />
<b>Gemeente:</b> '.$gemeente.'<br />
<b>Land:</b> '.$land.'<br />
<b>Telefoon/GSM:</b> '.$tel.'<br />
<b>2de Telefoon:</b> '.$tel2.'<br />
<b>Fax:</b> '.$fax.'<br />
<b>Email:</b> <a href="mailto:'.$email.'">'.$email.'</a><br />
<br />
<b>Deadline1:</b> '.$deadline1.'<br />
<b>Deadline2:</b> '.$deadline2.'<br />
<b>Deadline3:</b> '.$deadline3.'<br />
<b>Deadline geen:</b> '.$deadline_geen.'<br />
<b>Deadline andere:</b> '.$deadline_andere.'<br />
<b>Deadline andere 2:</b> '.$deadline_andere2.'<br />
<br />
<br />
--------------------------------------------------------------------------<br />
<b>Datum:</b> '.date("d-m-Y @ H:i:s").'<br /> <b>IP:</b> <a href=\"http://sunny.nic.com/cgi-bin/whois?domain='.$_SERVER['REMOTE_ADDR'].'\">'.$_SERVER['REMOTE_ADDR'].'</a><br />
</body>
</html>';
}
else
{
$bericht_wrap = wordwrap ($bericht, 40, "\n", 1); // Headers
$headers = "From: \"mijnwebsite\" <".$cfg['email'].">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset='iso-8859-1'\n";
// Bericht
$message = "Bedrijf: ".$bedrijf." \n";
$message = "Naam: ".$naam." \n";
$message = "Adres: ".$adres." \n";
$message = "Postcode: ".$postcode." \n";
$message = "Gemeente: ".$gemeente." \n";
$message = "Land: ".$land." \n";
$message = "Telefoon/GSM: ".$tel." \n";
$message = "2de Telefoon: ".$tel2." \n";
$message = "Fax: ".$fax." \n";
$message .= "E-mail: ".$email." \n";
$message .= " \n ";
$message .= "Deadline 1 maand: ".$deadline1." \n";
$message .= "Deadline 2 maanden: ".$deadline2." \n";
$message .= "Deadline 3 maanden: ".$deadline3." \n";
$message .= "Deadline andere: ".$deadline1_andere." \n";
$message .= "Deadline andere2: ".$deadline_andere2." \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] ", $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] ",$bericht, $headers);
}
unset($naam, $adres, $postcode, $gemeente, $land, $tel, $email);
header("http://www.mijnwebsite.be" );
}
else
{
echo "Er is een fout opgetreden bij het verzenden van de email"; }
header("refresh:3;url=".$cfg['url'].""); }
}
if($formulier)
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="nl-be">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>offerte</TITLE>
<meta name="description" content="offerte">
<meta name="keywords" content="offerte">
<meta name="re-visit" content="After 1 week">
<style type="text/css">
</style>
</head>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100%" valign="top" bgcolor="#FFFFFF"><table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="500" valign="top" class="spacer"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td height="10"><table width="630">
<tr>
<td>
<?php
}
?>
<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<table width="100%" border="0" class="black_txt_11">
<tr height="30">
<td colspan="4"><table width="100%" border="0">
<tr height="30">
<td colspan="4">Uw gegevens</td>
</tr>
<tr>
<td width="15%">Bedrijf</td>
<td width="34%"><input name="bedrijf" type="text" class="invulveld1" id="bedrijf" value="
<?php if (!empty($bedrijf)) { echo stripslashes($bedrijf); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['naam'])) { echo 'class="fout"'; } ?> /></td>
<td width="16%"> </td>
<td width="35%"> </td>
</tr>
<tr>
<td width="15%">Naam*</td>
<td width="34%"><input name="naam" type="text" class="invulveld1" id="naam" value="
<?php if (!empty($naam)) { echo stripslashes($naam); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['naam'])) { echo 'class="fout"'; } ?> /></td>
<td width="16%"> </td>
<td width="35%"> </td>
</tr>
<tr>
<td>Adres</td>
<td><input name="adres" type="text" class="invulveld1" id="adres" value="
<?php if (!empty($adres)) { echo stripslashes($adres); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['adres'])) { echo 'class="fout"'; } ?> /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Postcode</td>
<td><input name="postcode" type="text" class="invulveld1" id="postcode" value="
<?php if (!empty($postcode)) { echo stripslashes($postcode); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['postcode'])) { echo 'class="fout"'; } ?> /></td>
<td> Gemeente</td>
<td><input name="gemeente" type="text" class="invulveld1" id="gemeente" value="
<?php if (!empty($gemeente)) { echo stripslashes($gemeente); } ?>" maxlength="40"
<?php if(isset($fout['input']['gemeente'])) { echo 'class="fout"'; } ?> /></td>
</tr>
<tr>
<td>Land</td>
<td><input name="land" type="text" class="invulveld1" id="land" value="
<?php if (!empty($land)) { echo stripslashes($land); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['land'])) { echo 'class="fout"'; } ?> /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Telefoon/GSM</td>
<td><input name="tel" type="text" class="invulveld1" id="tel" value="
<?php if (!empty($tel)) { echo stripslashes($tel); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['tel'])) { echo 'class="fout"'; } ?> /></td>
<td> 2de Telefoon</td>
<td><input name="tel2" type="text" class="invulveld1" id="tel2" value="
<?php if (!empty($tel2)) { echo stripslashes($tel2); } ?>" maxlength="40"
<?php if(isset($fout['input']['tel2'])) { echo 'class="fout"'; } ?> /></td>
</tr>
<tr>
<td>Fax</td>
<td><input name="fax" type="text" class="invulveld1" id="fax" value="
<?php if (!empty($fax)) { echo stripslashes($fax); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['fax'])) { echo 'class="fout"'; } ?> /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Email*</td>
<td><input name="email" type="text" class="invulveld1" id="email" value="
<?php if (!empty($email)) { echo stripslashes($email); } ?>" size="29" maxlength="255"
<?php if(isset($fout['input']['email'])) { echo 'class="fout"'; } ?> /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="4" height="8"></td>
</tr>
<tr>
<td colspan="4" class="black_txt_11_bold"><span class="black_txt_11_gewoon">Deadline</span></td>
</tr>
<tr>
<td colspan="4"><input name="deadline1" type="checkbox" id="deadline1" value="
<?php if (!empty($deadline1)) { echo stripslashes($deadline1); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['deadline1'])) { echo 'class="fout"'; } ?> />
1 maand
<input name="deadline2" type="checkbox" id="deadline2" value="
<?php if (!empty($deadline2)) { echo stripslashes($deadline2); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['deadline2'])) { echo 'class="fout"'; } ?> />
2 maand
<input name="deadline3" type="checkbox" id="deadline3" value="
<?php if (!empty($deadline3)) { echo stripslashes($deadline3); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['deadline3'])) { echo 'class="fout"'; } ?> />
3 maand
<input name="deadline_geen" type="checkbox" id="deadline_geen" value="
<?php if (!empty($deadline_geen)) { echo stripslashes($deadline_geen); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['deadline_geen'])) { echo 'class="fout"'; } ?> />
geen deadline
<input name="deadline_andere" type="checkbox" id="deadline_andere" value="
<?php if (!empty($deadline_andere)) { echo stripslashes($deadline_andere); } ?>" size="29" maxlength="40"
<?php if(isset($fout['input']['deadline_andere'])) { echo 'class="fout"'; } ?> />
Andere
<input name="deadline_andere2" type="text" class="invulveld1" id="deadline_andere2" value="
<?php if (!empty($deadline_andere2)) { echo stripslashes($deadline_andere2); } ?>" size="29" maxlength="255"
<?php if(isset($fout['input']['deadline_andere2'])) { echo 'class="fout"'; } ?> /></td>
</tr>
<tr>
<td colspan="4" height="8"></td>
</tr>
<tr>
<td><?php
if($cfg['CAPTCHA'])
{
?>
<img src="captcha.php" alt="" /></td>
<td>Vul hier de code in
<input type="text" id="code" name="code" maxlength="4" size="4"
<?php if(isset($fout['input']['code'])) { echo 'class="captcha fout"'; } ?> /></td>
<td colspan="2"> </td>
</tr>
<tr>
<td><?php
}
?></td>
<td>Stuur mij een kopie
<input type="checkbox" id="stuurkopie" name="stuurkopie" value="1" /></td>
<td colspan="2"> </td>
</tr>
</table> </td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td align="right"><input type="submit" id="verzenden" name="verzenden" value="verzenden" /></td>
<td><input type="submit" id="wis" name="wis" value="Wis velden" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td ></td>
</tr>
</table></td>
<td width="2"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" background="../images/degab.gif"></td>
</tr>
<tr>
<td width="822"><!-- Einde footer -->
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
}
else
{
<p>
U kunt maar eens in de ".$cfg['spam']." minuten een e-mail versturen!<br />
U wordt nu automatisch doorgestuurd.
</p>";
header("refresh:3;url=".$cfg['url'].""); }
?>