<?php
// your name
$recipientname = "KAG";
// your email
$recipientemail = "***@hotmail.com";
// subject of the email sent to you
$subject = "Bericht van online contactformulier (kag.nl)";
// send an autoresponse to the user?
$autoresponse = "yes";
// subject of autoresponse
$autosubject = "K.A.G.";
// autoresponse message
$automessage = "Beste $Naam,
Dit is een automatisch gegenereerd bericht om te melden dat wij uw bericht succesvol hebben ontvangen in onze mailbox.
Wij streven ernaar zo snel mogelijk reactie te geven.
Met vriendelijke groeten,
K.A.G.";
// thankyou displayed after the user clicks "submit"
$thanks = "Bedankt voor het gebruiken van ons online contact formulier!<br>";
?>
<style type="text/css"><!--
td,body,input,textarea {
font-size:12px;
font-family:Verdana,Arial,Helvetica,sans-serif;
color:#000000}
--></style>
</head>
<body bgcolor="fce08b">
<body>
<table width="100%" height="100%"><tr>
<td valign="top"><font face="Verdana,Arial,Helvetica" size="2">
<?php
if($_POST['submitform']) {
$Naam = $HTTP_POST_VARS['Naam'];
$Email = $HTTP_POST_VARS['email'];
$onderwerp = $HTTP_POST_VARS['onderwerp'];
$bericht = $HTTP_POST_VARS['bericht'];
$functie = $HTTP_POST_VARS['functie'];
// check required fields
$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "$dcheck[$check]<br>";
}
}
// check email address
if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $Email))){
$error .= "Onbekent e-mail adres<br>";}
// display errors
if($error) {
?>
<b><font color="Darkred"><br><br>Foutje! U bent het volgende vergeten in te vullen:</b><br>
<?php echo $error; ?><br>
<a href="#" onClick="history.go(-1)">Ga terug</a> en probeer het opnieuw.</font>
<?php
}
else
{
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;
// format message
$message = "Het volgende bericht is verstuurd via het online contact formulier op ***.nl:
Naam: $Naam
E-mail: $Email
Functie: $functie
Onderwerp: $onderwerp
Bericht:
$bericht
-------------Informatie afzender----------------
Browser: $browser
Gebruikers IP: $ip";
// send mail and print success message
mail($recipientemail,"$subject","$message","From: $Name <$Email>");
if($autoresponse == "yes") {
$autosubject = stripslashes($autosubject);
$automessage = stripslashes($automessage);
mail($Email,"$autosubject","$automessage","From: $recipientname <$recipientemail>");
}
echo "$thanks";
}
}
else {
?>
<form name="contactform" action="<?php echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="require" value="Naam,email,onderwerp,bericht">
<table bgcolor="#D3D3D3" border="1" width="480" align="center">
<p>
<tr>
<td valign="top" align="left" width="30%"> Naam *</td>
<td valign="top" width="70%"><input name="Naam" size="25"></td>
</tr><tr>
<td valign="top" align="left"> Functie</td>
<td valign="top"><input name="functie" size="25"></td>
</tr><tr>
<td valign="top" align="left"> E-mail *</td>
<td valign="top"><input name="Email" size="25"></td>
</tr><tr>
<td valign="top" align="left"> Onderwerp *</td>
<td valign="top"><input name="onderwerp" size="50"></td>
</tr><tr>
<td valign="top" align="left"> Bericht *</td>
<td valign="top"><TEXTAREA COLS=50 ROWS=10 NAME="bericht" WRAP=VIRTUAL>
</TEXTAREA>
</td>
</tr>
<tr height="30" border="0">
<table border="0" bgcolor="#ADD8E6" width="480" height="60" align="center">
<tr>
<td colspan="2" align="right" border="0"><input type="submit" value="Verzenden" name="submitform">
<input type="reset" value="Reset" name="reset"> </td>
</tr><tr border="0">
<td border="0"><font face="verdana" size="1">
<i>* Deze velden zijn verplicht in te vullen</i></td></tr></table> </table>
</form>
<?php } ?>
</font><p></td>
</tr></table>