<% /*<%= $DH->submenu(); %>*/ %>
<% if(empty($selectedID)){%>
<% } else { //there is a selection
echo '
'; include_once('contact.inc'); /************************************************************\ ** Error Checking \************************************************************/ function check_errors(){ // This test prevents values being entered in a URL if ($_SERVER['REQUEST_METHOD'] != "POST"){ Err::register( __FILE__,__LINE__,'Method '.$_SERVER['REQUEST_METHOD'].' not allowed','method'); header('Location: /contact/'); exit(); } if(empty($_POST['from'])){ Err::register( __FILE__,__LINE__,dh_translate("Supply a name"),'from'); } if(empty($_POST['email'])){ Err::register( __FILE__,__LINE__,dh_translate("Supply an email address"),'email'); } else { Err::validateEmail($_POST['email']); } $text=trim(stripslashes($_POST['textmessage'])); if(empty($text)){ Err::register( __FILE__,__LINE__,dh_translate("No text"),'text'); } if(empty($_POST['number'])){ Err::register( __FILE__,__LINE__,dh_translate("Supply the image code"),'ImageValue'); } elseif(md5(strtoupper($_POST['number'])) != $_SESSION['image_value']){ Err::register( __FILE__,__LINE__,dh_translate("Wrong image code. Try again"),'ImageValue'); } return Err::hasErr(); } /************************************************************\ ** Determining the action \************************************************************/ $selected=$email[$selectedID]; // Shouldn't be empty there... if(!isset($_POST['action'])){ $action = "display"; } elseif ($_POST['action'] == 'send'){ $action =(check_errors())?"display":"send"; } /************************************************************\ ** Processing information \************************************************************/ if($action == "display"){ $thefrom = trim(stripslashes($_POST['from'])); $theemail = trim(stripslashes($_POST['email'])); $theheader = (isset($_POST['header']))?trim(stripslashes($_POST['header'])):trim(stripslashes($_GET['preheader'])); $thetextmessage = (isset($_POST['textmessage']))?trim(stripslashes($_POST['textmessage'])):trim(stripslashes($_GET['pretext'])); %> <% }elseif($action == "send"){ $from = trim($_POST['from']); $fromEmail = trim($_POST['email']); $to = $email[$selectedID]['email']; $toName = $email[$selectedID]['name']; $subject = "[DH] ".utf8_decode(trim($_POST['header'])); //$body = str_replace("\n","
",trim(stripslashes($_POST['textmessage']))); $body = "========================\n"; $body .= "From: ".utf8_decode($from)." <".utf8_decode($fromEmail).">"; $body .= "\n========================\n"; $body .= utf8_decode(trim(stripslashes($_POST['textmessage']))); if($to == 'webmaster@dansenshus.info'){ $body .= "\n\n\n=========== EXTRA INFO =============\n"; $body .= "Remote Address: ".$_SERVER['REMOTE_ADDR']."\n"; $body .= "HTTP User Agent: ".$_SERVER['HTTP_USER_AGENT']."\n"; $body .= "ISO Date: ".date('c'); } $headers["From"] = '"'.$from.'" <'.$fromEmail.'>'; $headers["Reply-To"]= '<'.$fromEmail.'>'; $headers["X-Mailer"]= 'PHP '. phpversion(); echo '
';
echo '
'; include_once('email.inc'); if (dh_sendMail($to, $subject, $body, $headers)) { echo("';
//$WebmasterHeaders["To"] = '"DH Webmaster" ';
$WebmasterHeaders["X-Mailer"]= 'PHP '. phpversion();
dh_sendMail("webmaster@dansenshus.info", "[DH] Email Logging Tools", $copyToWebmaster,$WebmasterHeaders);
}
} else {
echo("
';
}
Err::resetLog();
}
%>
<%= dh_translate('email_to_whom');%>
| ';
$code .= '';
$code .= ' '.$arr["name"].''; $code .= ''; $code .= ' | ';
$code .="\n";
}
echo $code."\n";
?>
'; if($_SESSION['lang']=='fr'){echo 'Email à "';} elseif($_SESSION['lang']=='en'){echo 'Email to "';} else{echo 'Email till "';} echo $email[$selectedID]['name']; echo '"
'; include_once('contact.inc'); /************************************************************\ ** Error Checking \************************************************************/ function check_errors(){ // This test prevents values being entered in a URL if ($_SERVER['REQUEST_METHOD'] != "POST"){ Err::register( __FILE__,__LINE__,'Method '.$_SERVER['REQUEST_METHOD'].' not allowed','method'); header('Location: /contact/'); exit(); } if(empty($_POST['from'])){ Err::register( __FILE__,__LINE__,dh_translate("Supply a name"),'from'); } if(empty($_POST['email'])){ Err::register( __FILE__,__LINE__,dh_translate("Supply an email address"),'email'); } else { Err::validateEmail($_POST['email']); } $text=trim(stripslashes($_POST['textmessage'])); if(empty($text)){ Err::register( __FILE__,__LINE__,dh_translate("No text"),'text'); } if(empty($_POST['number'])){ Err::register( __FILE__,__LINE__,dh_translate("Supply the image code"),'ImageValue'); } elseif(md5(strtoupper($_POST['number'])) != $_SESSION['image_value']){ Err::register( __FILE__,__LINE__,dh_translate("Wrong image code. Try again"),'ImageValue'); } return Err::hasErr(); } /************************************************************\ ** Determining the action \************************************************************/ $selected=$email[$selectedID]; // Shouldn't be empty there... if(!isset($_POST['action'])){ $action = "display"; } elseif ($_POST['action'] == 'send'){ $action =(check_errors())?"display":"send"; } /************************************************************\ ** Processing information \************************************************************/ if($action == "display"){ $thefrom = trim(stripslashes($_POST['from'])); $theemail = trim(stripslashes($_POST['email'])); $theheader = (isset($_POST['header']))?trim(stripslashes($_POST['header'])):trim(stripslashes($_GET['preheader'])); $thetextmessage = (isset($_POST['textmessage']))?trim(stripslashes($_POST['textmessage'])):trim(stripslashes($_GET['pretext'])); %> <% }elseif($action == "send"){ $from = trim($_POST['from']); $fromEmail = trim($_POST['email']); $to = $email[$selectedID]['email']; $toName = $email[$selectedID]['name']; $subject = "[DH] ".utf8_decode(trim($_POST['header'])); //$body = str_replace("\n","
",trim(stripslashes($_POST['textmessage']))); $body = "========================\n"; $body .= "From: ".utf8_decode($from)." <".utf8_decode($fromEmail).">"; $body .= "\n========================\n"; $body .= utf8_decode(trim(stripslashes($_POST['textmessage']))); if($to == 'webmaster@dansenshus.info'){ $body .= "\n\n\n=========== EXTRA INFO =============\n"; $body .= "Remote Address: ".$_SERVER['REMOTE_ADDR']."\n"; $body .= "HTTP User Agent: ".$_SERVER['HTTP_USER_AGENT']."\n"; $body .= "ISO Date: ".date('c'); } $headers["From"] = '"'.$from.'" <'.$fromEmail.'>'; $headers["Reply-To"]= '<'.$fromEmail.'>'; $headers["X-Mailer"]= 'PHP '. phpversion(); echo '
';
echo ''.dh_translate('thanks').', '.$from.' ['.$fromEmail.']
'; echo ''.$toName.' '.dh_translate('is grateful for your comments').'.
';
echo '
'.dh_translate('mvh').'
'; include_once('email.inc'); if (dh_sendMail($to, $subject, $body, $headers)) { echo("
Message sent!
"); // Copy to Webmaster... if($to != 'webmaster@dansenshus.info'){ $copyToWebmaster = "========================\n"; //$copyToWebmaster .= "From: ".utf8_decode($from)." <".utf8_decode($fromEmail).">"; //$copyToWebmaster .= "\n========================\n"; $copyToWebmaster .= "Directed to: $toName <$to>"; $copyToWebmaster .= "\n========================\n"; $copyToWebmaster .= "Subject: ".$subject; $copyToWebmaster .= "\n=========== BODY =============\n"; $copyToWebmaster .= $body; $WebmasterHeaders["From"] = '"DH Webmaster"Message delivery failed...
"); } echo('Back to the homepage
'); echo '
<%
switch($_SESSION['lang'])
{
case 'fr':
echo '