<?php
$emailadres = "cowbeast007@hotmail.com";
$sitenaam = "cowbeast.be";
if(isset($_GET['actie']) == "verzenden") {
if(empty($_POST['onderwerp']) || empty($_POST['naam']) || empty($_POST['email']) || empty($_POST['bericht']) || empty($_POST['voornaam']) || empty($_POST['site'])) {
echo "Je moet wel alle velden invullen!!"; }
else
{
mail($emailadres, $onderwerp, "Afzender: $voornaam $naam \nEmail adres: $email \nWebsite: $site Onderwerp: \n$onderwerp \nIP: ".$_SERVER['REMOTE_ADDR']." \n\nBericht: \n$bericht", "From: $naam || $sitenaam"); echo "Bericht succesvol verzonden!"; }
}
else
{
?>
<form method="post" name="verzenden" action="<?=$_SERVER['PHP_SELF']?>?actie=verzenden">
<table width="310" border="0" bgcolor="#CCCCCC">
<tr>
<td height="16" width="168"> <img src="form/naam.gif" width="16" height="15"> Naam:</td>
<td height="16" width="132">
<input type="text" name="naam" size="22"></td>
</tr>
<tr>
<td height="16" width="168"><img src="form/naam.gif" width="16" height="15"> Voornaam:</td>
<td height="16" width="132">
<input type="text" name="voornaam" size="22"></td>
</tr>
<tr>
<td height="27" width="168"><img src="form/email.gif" width="15" height="15"> Emailadres:</td>
<td height="27" width="132">
<input type="text" name="email" size="22"></td>
</tr>
<tr>
<td height="16" width="168"><img src="form/website.gif" width="16" height="16"> Website:</td>
<td height="16" width="132">
<input type="text" name="site" size="22"></td>
</tr>
<tr>
<td height="17" width="168"><img src="form/bericht.gif" width="16" height="16"> Onderwerp:</td>
<td height="17" width="132">
<input type="text" name="onderwerp" size="22"></td>
</tr>
<tr>
<td height="140" colspan="2" align="center">
<textarea name="bericht" rows="8" cols="47">Tik hier je tekst...</textarea></td>
</tr>
<tr>
<td height="18" colspan="2" align="center">
<input type="submit" value="Verzenden!" name="verzenden"> <input type="reset" value="Wissen" name="wissen">
</td>
</tr>
</table>
</form>
<?php
}
?>