<?php
## <Securimage>
require_once 'captcha/securimage.php';
$image = new Securimage();
## </Securimage>
if(isset($_POST['submitted']))
{
if($image->check($_POST['captcha']) == true){
//voer verstuur script uit.
## <To:>
switch($_POST['categorie'])
{
case "1":
$to = "1@hotmail.com";
break;
case "2":
$to = "2@hotmail.com";
break;
case "3":
$to = "3@hotmail.com";
break;
case "4":
$to = "4@hotmail.com, 4@live.nl";
break;
case "5":
$to = "5@hotmail.com, 5@hotmail.nl, 5@live.nl";
break;
case "6":
$to = "6@hotmail.com";
break;
case "7":
$to = "7@hotmail.com";
break;
default:
echo "Selecteer een categorie";
die();
break;
}
##</To:>
##subject
$subject = "Contactforumlier: ".$_POST['categorie'].": ".$_POST['onderwerp'];
## message
$message = $_POST['voornaam']." ".$_POST['achternaam']." schreef: \n\r".$_POST['bericht'];
## Headers:
$headers = 'From: ' . $_POST['eigenemail'] . "\r\n" .
'Reply-To: ' . $_POST['eigenemail'] . "\r\n" .
'X-Mailer: PHP/' . phpversion();
## mailen
mail($to,$subject,$message,$headers);
}else{
?>
Foute code
<?php
}}else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="<?=strip_tags($_SERVER['PHP_SELF'])?>">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3" align="center"><strong>Contact</strong></td>
</tr>
<tr>
<td width="78">Eigen email</td>
<td width="6">:</td>
<td width="294"><input name="eigenemail" type="text" id="eigenemail" /></td>
</tr>
<tr>
<td>Voornaam</td>
<td>:</td>
<td><input name="voornaam" type="text" id="voornaam" /></td>
</tr>
<tr>
<td>Achternaam</td><td>:</td><td><input type="text" name="achternaam" id="achternaam" /></td>
</tr>
<tr>
<td>Categorie</td><td>:</td><td>
<select name="categorie">
<option value="1" selected="selected" id="selecteer">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
</td></tr>
<tr>
<td>Onderwerp</td><td>:</td><td><input type="text" name="onderwerp" /></td>
</tr>
<tr>
<td>Bericht</td><td>:</td><td>
<textarea rows="10" cols="40" name="bericht">
</textarea></td>
</tr>
<tr><td colspan="3" align="center"><img src="captcha/securimage_show.php" /></td></tr>
<tr><td>Code</td><td>:</td><td><input type="text" name="captcha" /></td></tr>
<tr>
<td align="center" colspan="3"><input type="hidden" name="submitted" value="submitted" /><input type="submit" name="Submit" value="Verstuur"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</body>
</html><?php } ?>