Nieuw lid |
|
ik heb zojuist hier een e-mail formulier gevonden, maar ik krijg hem niet werkent:?: kan misschien iemand er naar kijken of alles goed is?
<? ob_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$site = "http://jordy.collem.nl";
$wm_naam = "jordy";
$wm_email = "jordy@collem.nl";
$Anti_Spam = "10";
$fout_text = TRUE;
$fout_vakje = TRUE;
$html = TRUE;
$ip = $_SERVER['REMOTE_ADDR'];
$host = gethostbyaddr($ip);
function checkmail($email)
{
$email_host = explode("@", $email);
$email_host = $email_host[1];
$email_resolved = gethostbyname($email_host);
if($email_resolved == $email_host)
{
$valid = FALSE;
}
if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$email))
{
$valid = TRUE;
}
else
{
$valid = FALSE;
}
return $valid;
}
if(!isset($_COOKIE['mailformulier']))
{
if(isset($_POST['wis']))
{
foreach ($_POST as $key => $value)
{
unset($value);
}
header("Location: ".$_SERVER['PHP_SELF']."");
}
if(isset($_POST['verzenden']))
{
$naam = trim($_POST['naam']);
$email = trim($_POST['email']);
$onderwerp = trim($_POST['onderwerp']);
$bericht = trim($_POST['bericht']);
$fout = "";
if($html)
{
// Headers
$headers = "From: \"Contact Formulier\" <".$wm_email.">\r\n";
$headers .= "Reply-To: \"".$naam."\" <".$email.">\n";
$headers .= "Return-Path: Mail-Error <".$wm_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
$message = "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<style type=\"text/css\">
body {
border-right: 5px;
border-top: 5px;
border-left: 5px;
border-bottom: 5px;
font: 10px Verdana, Arial, Helvetica, sans-serif;
}
table {
font: 10px Verdana, Arial, Helvetica, sans-serif;
}
table, a:link {
color: #000;
text-decoration: none;
}
table, a:visited {
color: #000;
text-decoration: none;
}
table, a:hover {
color: #000;
font-weight: bold;
text-decoration: none;
}
</style>
</head>
<body>
<br />
<table>
<tr><td>Naam:</td><td>".$naam."</td></tr>
<tr><td>Email:</td><td><a href=\"mailto:".$email."\">".$email."</a></td></tr>
<br />
<tr><td>Bericht:</td><td>".$bericht."</td></tr>
<tr><td colspan=\"2\"> </td></tr>
<br />
<tr><td>Datum:</td><td>".date("d-m-Y H:i:s")."</td></tr>
<tr><td>IP:</td><td><a href=\"http://sunny.nic.com/cgi-bin/whois?domain=".$ip."\">".$ip."</a></td></tr>
<tr><td>Host:</td><td>".$host."</td></tr>
</table>
</body>
</html>";
}
else
{
$bericht_wrap = wordwrap ($bericht, 40, "\n", 1);
// Headers
$headers = "From: \"Contact Formulier\" <".$wm_naam.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset='iso-8859-1'\n";
// Bericht
$message = "Naam: ".$naam." \n";
$message .= "E-mail: ".$email." \n";
$message .= "Bericht:\n".$bericht_wrap." \n ";
$message .= " \n ";
$message .= "Datum: ".date("d-m-Y H:i:s")." \n";
$message .= "------------------------------------------------------- \n ";
$message .= "IP: ".$ip." \n ";
$message .= "Host: ".$host." \n ";
}
if((empty($naam)) OR (strlen($naam) < 3) OR (eregi("[<>]", $naam)))
{
$fout .= "U bent vergeten uw naam in te vullen! <br />";
unset($naam);
$fout_vakje_naam = "input_fout";
$fout_text_naam = "text_fout";
}
if((empty($email)) OR (strlen($email) < 7) OR (eregi("[<>]", $email)))
{
$fout .= "U bent vergeten uw e-mail adres in te vullen! <br />";
unset($email);
$fout_vakje_email = "input_fout";
$fout_text_email = "text_fout";
}
elseif(checkmail($email) == 0)
{
$fout .= "Vul een correct e-mail adres in! <br />";
unset($email);
$fout_vakje_email = "input_fout";
$fout_text_email = "text_fout";
}
if((empty($onderwerp)) OR (strlen($onderwerp) < 3) OR (eregi(">", $onderwerp)) )
{
$fout .= "U bent vergeten een onderwerp in te vullen! <br />";
unset($onderwerp);
$fout_vakje_onderwerp = "input_fout";
$fout_text_onderwerp = "text_fout";
}
if(empty($bericht))
{
$fout .= "U bent vergeten een bericht in te vullen! <br />";
unset($bericht);
$fout_vakje_bericht = "input_fout";
$fout_text_bericht = "text_fout";
}
elseif(strlen($bericht) < 6)
{
$fout .= "Uw bericht is tekort! <br />";
$fout_vakje_bericht = "input_fout";
$fout_text_bericht = "text_fout";
}
if(!$fout_text)
{
unset($fout_text_naam);
unset($fout_text_email);
unset($fout_text_onderwerp);
unset($fout_text_bericht);
}
if(!$fout_vakje)
{
unset($fout_vakje_naam);
unset($fout_vakje_email);
unset($fout_vakje_onderwerp);
unset($fout_vakje_bericht);
}
if(!empty($fout))
{
echo "\n<p style=\"color:#FF0000;\">\n".$fout."<br />\n</p>\n"; // Weergeven van de fout(en)
}
else
{
mail($wm_email,$onderwerp,$message,$headers);
// Bericht als mail succesvol is verzonden
echo "<head><link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"></head>";
echo "<br /><p style=\"text-align: center;\">Uw contact bericht is succesvol verzonden!<br />";
echo "Er word zo snel mogelijk gereageerd.<br /><br />";
echo "Met vriendelijke groeten,<br />";
echo "<b>".$wm_naam."</b></p>";
// cookie zetten tegen spam
setcookie("mailformulier",1,time()+($Anti_Spam*60));
// formulier wordt niet weer getoond
$Formulier = TRUE;
header("refresh:3;url=".$site."");
}
}
}
else {
$Formulier = FALSE;
echo "<html><head><link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body>";
echo "<p style=\"text-align: center;\"><h2> Spam Beveiliging </h2><br />";
echo "U kunt maar eens in de $Anti_Spam minuten een e-mail versturen!</p></body></html>";
header("refresh:3;url=".$site."");
}
if(!isset($Formulier))
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Contact Formulier</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
/* Created by Thijs */
/* http://www.ferket.net */
</head>
<body>
<table class="tabel" border="1" cellpadding="5" cellspacing="0" width="300">
<tr>
<td><br />
<form method="post" action="<? $_SERVER['PHP_SELF']; ?>">
<table>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="<? echo $fout_text_naam; ?>">Naam:</td>
<td><input type="text" class="<? echo $fout_vakje_naam; ?>" id="naam" name="naam" maxlength="20" value="<? if (!empty($naam)) { echo stripslashes($naam); } ?>" /></td>
</tr>
<tr>
<td class="<? echo $fout_text_email; ?>">Email:</td>
<td><input type="text" class="<? echo $fout_vakje_email; ?>" id="email" name="email" maxlength="30" value="<? if (!empty($email)) { echo $email; } ?>" /></td>
</tr>
<tr>
<td class="<? echo $fout_text_onderwerp; ?>">Onderwerp:</td>
<td><input type="text" class="<? echo $fout_vakje_onderwerp; ?>" id="onderwerp" name="onderwerp" maxlength="30" value="<? if (!empty($onderwerp)) { echo stripslashes($onderwerp); } ?>" /></td>
</tr>
<tr>
<td valign="top" class="<? echo $fout_text_bericht; ?>">Bericht:</td>
<td><textarea id="bericht" name="bericht" class="<? echo $fout_vakje_bericht; ?>" cols="35" rows="6"><? if (!empty($bericht)) { echo stripslashes($bericht); } ?></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" id="verzenden" name="verzenden" value="Verzenden" /><input type="submit" id="wis" name="wis" value="Wis velden" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
<?
}
?>
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); $site = "http://jordy.collem.nl"; $wm_naam = "jordy"; $wm_email = "jordy@collem.nl"; $Anti_Spam = "10"; $fout_text = TRUE; $fout_vakje = TRUE; $html = TRUE; $ip = $_SERVER['REMOTE_ADDR']; function checkmail($email) { $email_host = explode("@", $email); $email_host = $email_host[1]; if($email_resolved == $email_host) { $valid = FALSE; } if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$email)) { $valid = TRUE; } else { $valid = FALSE; } return $valid; } if(!isset($_COOKIE['mailformulier'])) { { foreach ($_POST as $key => $value) { } header("Location: ".$_SERVER['PHP_SELF'].""); } if(isset($_POST['verzenden'])) { $naam = trim($_POST['naam']); $email = trim($_POST['email']); $onderwerp = trim($_POST['onderwerp']); $bericht = trim($_POST['bericht']); $fout = ""; if($html) { // Headers $headers = "From: \"Contact Formulier\" <".$wm_email.">\r\n"; $headers .= "Reply-To: \"".$naam."\" <".$email.">\n"; $headers .= "Return-Path: Mail-Error <".$wm_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 $message = " <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> <html> <head> <style type=\"text/css\"> body { border-right: 5px; border-top: 5px; border-left: 5px; border-bottom: 5px; font: 10px Verdana, Arial, Helvetica, sans-serif; } table { font: 10px Verdana, Arial, Helvetica, sans-serif; } table, a:link { color: #000; text-decoration: none; } table, a:visited { color: #000; text-decoration: none; } table, a:hover { color: #000; font-weight: bold; text-decoration: none; } </style> </head> <body> <br /> <table> <tr><td>Naam:</td><td>".$naam."</td></tr> <tr><td>Email:</td><td><a href=\"mailto:".$email."\">".$email."</a></td></tr> <br /> <tr><td>Bericht:</td><td>".$bericht."</td></tr> <tr><td colspan=\"2\"> </td></tr> <br /> <tr><td>Datum:</td><td>".date("d-m-Y H:i:s")."</td></tr> <tr><td>IP:</td><td><a href=\"http://sunny.nic.com/cgi-bin/whois?domain=".$ip."\">".$ip."</a></td></tr> <tr><td>Host:</td><td>".$host."</td></tr> </table> </body> </html>"; } else { $bericht_wrap = wordwrap ($bericht, 40, "\n", 1); // Headers $headers = "From: \"Contact Formulier\" <".$wm_naam.">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset='iso-8859-1'\n"; // Bericht $message = "Naam: ".$naam." \n"; $message .= "E-mail: ".$email." \n"; $message .= "Bericht:\n".$bericht_wrap." \n "; $message .= " \n "; $message .= "Datum: ".date("d-m-Y H:i:s")." \n"; $message .= "------------------------------------------------------- \n "; $message .= "IP: ".$ip." \n "; $message .= "Host: ".$host." \n "; } { $fout .= "U bent vergeten uw naam in te vullen! <br />"; $fout_vakje_naam = "input_fout"; $fout_text_naam = "text_fout"; } { $fout .= "U bent vergeten uw e-mail adres in te vullen! <br />"; $fout_vakje_email = "input_fout"; $fout_text_email = "text_fout"; } elseif(checkmail($email) == 0) { $fout .= "Vul een correct e-mail adres in! <br />"; $fout_vakje_email = "input_fout"; $fout_text_email = "text_fout"; } if((empty($onderwerp)) OR (strlen($onderwerp) < 3) OR (eregi(">", $onderwerp)) ) { $fout .= "U bent vergeten een onderwerp in te vullen! <br />"; $fout_vakje_onderwerp = "input_fout"; $fout_text_onderwerp = "text_fout"; } { $fout .= "U bent vergeten een bericht in te vullen! <br />"; $fout_vakje_bericht = "input_fout"; $fout_text_bericht = "text_fout"; } { $fout .= "Uw bericht is tekort! <br />"; $fout_vakje_bericht = "input_fout"; $fout_text_bericht = "text_fout"; } if(!$fout_text) { unset($fout_text_onderwerp); unset($fout_text_bericht); } if(!$fout_vakje) { unset($fout_vakje_email); unset($fout_vakje_onderwerp); unset($fout_vakje_bericht); } { echo "\n<p style=\"color:#FF0000;\">\n".$fout."<br />\n</p>\n"; // Weergeven van de fout(en) } else { mail($wm_email,$onderwerp,$message,$headers); // Bericht als mail succesvol is verzonden echo "<head><link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"></head>"; echo "<br /><p style=\"text-align: center;\">Uw contact bericht is succesvol verzonden!<br />"; echo "Er word zo snel mogelijk gereageerd.<br /><br />"; echo "Met vriendelijke groeten,<br />"; echo "<b>".$wm_naam."</b></p>"; // cookie zetten tegen spam // formulier wordt niet weer getoond $Formulier = TRUE; header("refresh:3;url=".$site.""); } } } else { $Formulier = FALSE; echo "<html><head><link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body>"; echo "<p style=\"text-align: center;\"><h2> Spam Beveiliging </h2><br />"; echo "U kunt maar eens in de $Anti_Spam minuten een e-mail versturen!</p></body></html>"; header("refresh:3;url=".$site.""); } { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link href="style.css" rel="stylesheet" type="text/css" /> <title>Contact Formulier</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> /* Created by Thijs */ /* http://www.ferket.net */ </head> <body> <table class="tabel" border="1" cellpadding="5" cellspacing="0" width="300"> <tr> <td><br /> <form method="post" action="<? $_SERVER['PHP_SELF']; ?>"> <table> <tr> <td> </td> <td> </td> </tr> <tr> <td class=" <? echo $fout_text_naam; ?>">Naam:</td> <td><input type="text" class=" <? echo $fout_vakje_naam; ?>" id="naam" name="naam" maxlength="20" value=" <? if (!empty($naam)) { echo stripslashes($naam); } ?>" /></td> </tr> <tr> <td class=" <? echo $fout_text_email; ?>">Email:</td> <td><input type="text" class=" <? echo $fout_vakje_email; ?>" id="email" name="email" maxlength="30" value=" <? if (!empty($email)) { echo $email; } ?>" /></td> </tr> <tr> <td class=" <? echo $fout_text_onderwerp; ?>">Onderwerp:</td> <td><input type="text" class=" <? echo $fout_vakje_onderwerp; ?>" id="onderwerp" name="onderwerp" maxlength="30" value=" <? if (!empty($onderwerp)) { echo stripslashes($onderwerp); } ?>" /></td> </tr> <tr> <td valign="top" class=" <? echo $fout_text_bericht; ?>">Bericht:</td> <td><textarea id="bericht" name="bericht" class=" <? echo $fout_vakje_bericht; ?>" cols="35" rows="6"> <? if (!empty($bericht)) { echo stripslashes($bericht); } ?></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" id="verzenden" name="verzenden" value="Verzenden" /><input type="submit" id="wis" name="wis" value="Wis velden" /></td> </tr> </table> </form> </td> </tr> </table> </body> </html> <? } ?>
alvast bedankt
jordy
|