229 views
Opgelost!
en [/ignore] tags om je code heen. Om php code zet je uiteraard dit:<?php en ?>Gebruik je
knop om dit te doen.Daniel schreef op 27.03.2009 15:40je bent een "; vergeten bij een echo in je php script.
<?php
ob_start();
?>
<!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>Zeg het Voort</title>
</head>
<body>
<?php
if(count($_POST)) {
# This section nukes nasty code that a malicious
# party may attempt to inject into the form
foreach(array('friendmail1','friendmail2','friendmail3','email','name') as $key) $_POST[$key] = strip_tags($_POST[$key]);
if(!is_secure($_POST)) { die("Asta la vista Hacker");}
# This section sends an email to you when
# the form is used
// Your email address (for copies to be sent to you)
$emailto = "[email protected]";
// Your email subject text
$esubject = "Zeg-het-voort-formulier is gebruikt";
// The email text for copies sent to you
$emailtext = "
$_POST[name] heeft 'Zeg het voort' gebruikt. Het emailadres is $_POST[email]
De website is aangeraden aan de volgende mensen:
$_POST[friendmail1]
$_POST[friendmail2]
$_POST[friendmail3]
";
# This sends the email to you
@mail("$emailto", $esubject, $emailtext, "From: $_POST[email]");
# This section sends to the recipients
// Target page after successful submission
// Change thankyou.htm to suit
$thankyoupage = "thankyou.htm";
// Change the subject text below to suit
$tsubject = "$_POST[name] wil u dit laten zien";
// Change the text below for the email
// Don't change any "$_POST[value]" items
$ttext = "
Hoi,
TEKST EMAILBERICHT
";
# This emails the recommendation to the addresses submitted
@mail("$_POST[friendmail1],$_POST[friendmail2],$_POST[friendmail3]", $tsubject, $ttext, "FROM: $_POST[email]");
# After successful processing, the thank you page
header("Location: $thankyoupage");
exit;
}
# Don't change anything below
function is_secure($ar) {
$reg = "/(Content-Type|Bcc|MIME-Version|Content-Transfer-Encoding)/i";
if(!is_array($ar)) { return preg_match($reg,$ar);}
$incoming = array_values_recursive($ar);
foreach($incoming as $k=>$v) if(preg_match($reg,$v)) return false;
return true;
}
function array_values_recursive($array) {
$arrayValues = array();
foreach ($array as $key=>$value) {
if (is_scalar($value) || is_resource($value)) {
$arrayValues[] = $value;
$arrayValues[] = $key;
}
elseif (is_array($value)) {
$arrayValues[] = $key;
$arrayValues = array_merge($arrayValues, array_values_recursive($value));
}
}
return $arrayValues;
}
?>
</body>
</html>