Dit is de volledige code:
<?php
session_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Wesleybekaert.be</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="cssverticalmenu.js">
/***********************************************
* CSS Vertical List Menu- by JavaScript Kit (
www.javascriptkit.com)
* Menu interface credits:
http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/
* This notice must stay intact for usage
* Visit JavaScript Kit at
http://www.javascriptkit.com/ for this script and 100s more
***********************************************/
</script>
<script language="JavaScript">
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}
</script>
</head>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="10">
<tr>
<td colspan="3" class="blanco" align="center" valign="middle"><a href="http://
www.wesleybekaert.be/" target="_self"><img src="images/banner.jpg" alt="Home" border="0" longdesc="http://
www.wesleybekaert.be"></a></td>
</tr>
<tr>
<td width="150" class="blanco" align="left" valign="top">
<ul id="verticalmenu" class="glossymenu">
<li><a href="index.html" target="_self">Home</a></li>
<li><a href="fcdamberd.html" target="_self">FC Damberd</a></li>
<li><a href="fcdamberdhistorisch.html" target="_self">Historiek FC Damberd</a></li>
<li><a href="oorlog.html" target="_self">Oorlog in en rond Harelbeke</a></li>
<li><a href="oorlogsmonumenten.html" target="_self">Oorlogsmonumenten</a></li>
<li><a href="normandie.html" target="_self">Normandiƫ</a></li>
<li><a href="kinheim.html" target="_self">Kinheim</a></li>
<li><a href="euforia.html" target="_self">Kapsalon Euforia</a></li>
<li><a href="offline.html" target="_self">Offline-sites</a></li>
<li><a href="links.html" target="_self">Links</a></li>
<li><a href="contact.php" target="_self">Contact</a></li>
</ul>
</td>
<td width="500" class="blanco" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td><p><?php
// E-mailadres van de ontvanger
$mail_ontv = '
[email protected]'; // <<<----- voer jouw e-mailadres hier in!
// Speciale checks voor naam en e-mailadres
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
// naam controle
if (empty($_POST['naam']))
$naam_fout = 1;
// e-mail controle
if (function_exists('filter_var') && !filter_var($_POST['mail'], FILTER_VALIDATE_EMAIL))
$email_fout = 1;
// antiflood controle
if (!empty($_SESSION['antiflood']))
{
$seconde = 20; // 20 seconden voordat dezelfde persoon nog een keer een e-mail mag versturen
$tijd = time() - $_SESSION['antiflood'];
if($tijd < $seconde)
$antiflood = 1;
}
}
// Kijk of alle velden zijn ingevuld - naam mag alleen uit letters bestaan en het e-mailadres moet juist zijn
if (($_SERVER['REQUEST_METHOD'] == 'POST' && (!empty($antiflood) || empty($_POST['naam']) || !empty($naam_fout) || empty($_POST['mail']) || !empty($email_fout) || empty($_POST['bericht']) || empty($_POST['onderwerp']))) || $_SERVER['REQUEST_METHOD'] == 'GET')
{
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (!empty($naam_fout))
echo '<p>Uw naam is niet ingevuld.</p>';
elseif (!empty($email_fout))
echo '<p>Uw e-mailadres is niet juist.</p>';
elseif (!empty($antiflood))
echo '<p>U mag slechts één bericht per ' . $seconde . ' seconde versturen.</p>';
else
echo '<p>U bent uw naam, e-mailadres, onderwerp of bericht vergeten in te vullen.</p>';
}
// HTML e-mail formlier
echo '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '" />
<p>
<label for="naam">Naam:</label><br />
<input type="text" id="naam" name="naam" value="' . (isset($_POST['naam']) ? htmlspecialchars($_POST['naam']) : '') . '" /><br />
<label for="mail">E-mailadres:</label><br />
<input type="text" id="mail" name="mail" value="' . (isset($_POST['mail']) ? htmlspecialchars($_POST['mail']) : '') . '" /><br />
<label for="onderwerp">Onderwerp:</label><br />
<input type="text" id="onderwerp" name="onderwerp" value="' . (isset($_POST['onderwerp']) ? htmlspecialchars($_POST['onderwerp']) : '') . '" /><br />
<label for="bericht">Bericht:</label><br />
<textarea id="bericht" name="bericht" rows="8" style="width: 400px;">' . (isset($_POST['bericht']) ? htmlspecialchars($_POST['bericht']) : '') . '</textarea><br />
<input type="submit" name="submit" value=" Versturen " />
</p>
</form>';
}
// versturen naar
else
{
// set datum
$datum = date('d/m/Y H:i:s');
$inhoud_mail = "===================================================\n";
$inhoud_mail .= "Ingevulde contact formulier " . $_SERVER['HTTP_HOST'] . "\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= "Naam: " . htmlspecialchars($_POST['naam']) . "\n";
$inhoud_mail .= "E-mail adres: " . htmlspecialchars($_POST['mail']) . "\n";
$inhoud_mail .= "Bericht:\n";
$inhoud_mail .= htmlspecialchars($_POST['bericht']) . "\n\n";
$inhoud_mail .= "Verstuurd op " . $datum . " via het IP adres " . $_SERVER['REMOTE_ADDR'] . "\n\n";
$inhoud_mail .= "===================================================\n\n";
// --------------------
// spambot protectie
// ------
// van de tutorial:
http://www.phphulp.nl/php/tutorial/beveiliging/spam-vrije-contact-formulieren/340/
// ------
$headers = 'From: ' . htmlspecialchars($_POST['naam']) . ' <' . $_POST['mail'] . '>';
$headers = stripslashes($headers);
$headers = str_replace('\n', '', $headers); // Verwijder \n
$headers = str_replace('\r', '', $headers); // Verwijder \r
$headers = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $headers)); // Slashes van quotes
$_POST['onderwerp'] = str_replace('\n', '', $_POST['onderwerp']); // Verwijder \n
$_POST['onderwerp'] = str_replace('\r', '', $_POST['onderwerp']); // Verwijder \r
$_POST['onderwerp'] = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $_POST['onderwerp'])); // Slashes van quotes
if (mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers))
{
// zorg ervoor dat dezelfde persoon niet kan spammen
$_SESSION['antiflood'] = time();
echo '<h1>Het contactformulier is verzonden</h1>
<p>Bedankt voor het invullen van het contactformulier. Ik zal zo spoedig mogelijk contact met u opnemen.</p>';
}
else
{
echo '<h1>Het contactformulier is niet verzonden</h1>
<p><b>Mijn excuses.</b> Het contactformulier kon niet verzonden worden.</p>';
}
}
?></p>
</td>
</tr>
</table></td>
<td width="150" class="blanco" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><p><a href="javascript:window.external.AddFavorite('http://
www.wesleybekaert.be';, 'Wesleybekaert.be')"><img src=
"images/ster.gif" alt="Instellen als favoriet" border="0" /></a></p>
<p><a href="http://
www.facebook.com/wesley.bekaert" target="_blank"><img src="images/facebook-logo.gif" alt="Facebook" border="0" /></a></p>
<p><a href="https://twitter.com/wbekaert111" target="_blank"><img src="images/twitter.jpg" alt="Twitter@wbekaert111" border="0" /></a></p>
<p><a href="http://
www.linkedin.com/profile/view?id=183887410&trk=tab_pro" target="_blank"><img src="images/linkedin.jpg" alt="LinkedIn" border="0" /></a></p>
<p><a href="https://plus.google.com/u/0/113238820825314057383/posts" target="_blank"><img src="images/googleplus.jpg" alt="Google+" border="0" /></a></p>
<p><a href="http://instagram.com/wbekaert111" target="_blank"><img src="images/instagram.jpg" alt="Instagram" border="0" /></a></p></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" align="left" valign="top" class="blanco"><div align="right"><span class="style1">Copyright 2013 <a href="http://
www.wesleybekaert.be" target="_blank">wesleybekaert.be</a></span></div></td>
</tr>
</table>
</body>
</html>