Cent,
Here is the code - thanks for your prompt response.
<?php
// L10Fm - v1.01 rel 1 (12/10/03)
// requirements for session data -
// 1. LevelTen Hit Counter PHP v3.15 rel 3
// 2. L10HC_API.php v3.15 v1.0 rel 1
//
//////////////////////////////////////////////////////////////////////////////////////
//
// confinguration variables
//
//////////////////////////////////////////////////////////////////////////////////////
// List all domains, including posible subdomains (e.g. www.) that are allowed to submit
// requests to this script and the domains of any posible recipient email address.
$validReferrers = array('lasersgrowhair.com','www.lasersgrowhair.com','raywebprojects.com',' ');
// Use the this array (or create new arrays with a different association) to replace
// setting fields in the form. Don't delete the 'default' array.
$formAction['default'] = array(
'Recipient' => 'bob@raywebprojects.com',
'Recipient_cc' => '',
'Recipient_bcc' => '',
'subject' => 'Contact Form',
'redirect' => 'http://www.lasersgrowhair.com',
'email' => '',
'realname' => '',
'required' => '',
'format' => 'html',
'sesrep_max_items' => '20',
);
// If set to 0, the form can set the email recipient. For security reasons you should
// set this variable to 1.
$disableFormRecipients = 1;
//////////////////////////////////////////////////////////////////////////////////////
//
// Start of code
// Don't edit below this line
//
//////////////////////////////////////////////////////////////////////////////////////
$pageHdr = "<html><head><style>td {font: x-small, verdana, arial, helvetica, sans-serif;} h1 {font-size: medium;} .err {color: #EE0000; font-weight: bold;}</style></head><body bgcolor=#FFFFFF><table width='500' align=center><tr><td>";
$pageFtr = "</td></tr>\n</body></html>";
$L10_LIBLoaded = 0;
if(file_exists("L10_LIB.php")) {
include_once("L10_LIB.php");
$L10_LIBLoaded = 1;
}
$HTTP_REF = getenv('HTTP_REFERER');
$a = preg_replace("/https?:\/\//","",$HTTP_REF);
$a = explode("/",$a);
$a = array_shift($a);
if(!in_array($a,$validReferrers)) {
print "$pageHdr<p class=err>Invalid Referrer '$a'</p><p>Referrer does not have permission to access this LevelTen Formmail script.<p>For help on this issue, see <a href='http://www.leveltendesign.com/L10Apps/Fm/help_troubleshooting.php#invalidReferrer?hct=L10Fm-ErrMsg' target=_blank>LevelTen Formmail troubleshooting</a>$pageFtr";
exit;
}
if(($POST['form_action'] == '') || ($formAction[$POST['form_action']]['Recipient'] == '')) {
$fAIndex = 'default';
} else {
$fAIndex = $_POST['form_action'];
}
$Recipient = (!$disableFormRecipients && ($POST['Recipient'] != '')) ? $POST['Recipient'] : $formAction[$fAIndex]['Recipient'];
$subject = ($POST['subject'] != '') ? $POST['subject'] : $formAction[$fAIndex]['subject'];
$redirect = ($POST['redirect'] != '') ? $POST['redirect'] : $formAction[$fAIndex]['redirect'];
$email = ($POST['email'] != '') ? $POST['email'] : $formAction[$fAIndex]['email'];
$realname = ($POST['realname'] != '') ? $POST['realname'] : $formAction[$fAIndex]['realname'];
$Recipient_cc = (!$disableFormRecipients && ($POST['Recipient_cc'] != '')) ? $POST['Recipient_cc'] : $formAction[$fAIndex]['Recipient_cc'];
$Recipient_bcc = (!$disableFormRecipients && ($POST['Recipient_bcc'] != '')) ? $POST['Recipient_bcc'] : $formAction[$fAIndex]['Recipient_bcc'];
$format = ($POST['format'] != '') ? $POST['format'] : $formAction[$fAIndex]['format'];
$required = ($POST['required'] != '') ? $POST['required'] : $formAction[$fAIndex]['required'];
$sesrep_max_items = ($POST['sesrep_max_items'] != '') ? $POST['sesrep_max_items'] : $formAction[$fAIndex]['sesrep_max_items'];
$Recipient_secured = ($POST['Recipient_secured'] != '') ? $POST['Recipient_secured'] : $formAction[$fAIndex]['Recipient_secured'];
$a = explode("@",$Recipient);
$a = array_pop($a);
if(!in_array($a,$validReferrers)) {
print "$pageHdr<p class=err>Invalid Recipient '$Recipient'</p><p> Email address does not have permission to relay through this LevelTen Formmail script.<p>For help on this issue, see <a href='http://www.leveltendesign.com/L10Apps/Fm/help_troubleshooting.php#invalidReferrer?hct=L10Fm-ErrMsg' target=_blank>LevelTen Formmail troubleshooting</a>$pageFtr";
exit;
}
$rccArray = explode(",",$Recipient_cc);
$Recipient_cc = '';
if($rccArray[0] != '') {
foreach($rccArray as $rcc) {
$a = explode("@",$rcc);
$a = array_pop($a);
if(in_array($a,$validReferrers)) {
$Recipient_cc .= "$rcc,";
}
}
}
$Recipient_cc = substr($Recipient_cc,0,-1);
$rbccArray = explode(",",$Recipient_bcc);
$Recipient_bcc = '';
if($rbccArray[0] != '') {
foreach($rbccArray as $rbcc) {
$a = explode("@",$rbcc);
$a = array_pop($a);
if(in_array($a,$validReferrers)) {
$Recipient_bcc .= "$rbcc,";
}
}
}
$Recipient_bcc = substr($Recipient_bcc,0,-1);
$a = explode(",",$required);
if($a[0] != '') {
foreach($a as $req) {
if($_POST[$req] == '') {
print "$pageHdr<p class=err>Required Field '$req' is missing!</p><p> You must input a value for this field before submitting<p align=center><a href=\"".$HTTP_REFERER."\">back to form</a>$pageFtr";
exit;
}
}
}
$htmlFormat = (strtolower(substr($format,0,1)) == 'h');
$msg = '';
if($htmlFormat) {
$msg = "<html><head><style>td {font: x-small, verdana, arial, helvetica, sans-serif;} .fldname {font-weight:bold;font-size:x-small;} .flddata {font-size:x-small;} .tblhdr { font-size:x-small;font-weight:bold;color:#FFFFFF;background-color=#000088}</style></head><body>\n";
$msg .= "<table border=0 cellspacing=0 cellpadding=0 width=640>\n";
$msg .= "<tr><td colspan=3 class='tblhdr'>AAvant-garde Contact Form</td></tr>\n";
} else {
$msg = "AAvant-garde Contact Form\n\n";
}
$bl0 = '';
$bl1 = '';
$ld = ' ';
$el = "\n\n";
$creditStrAdd = '';
if($htmlFormat) {
$bl0 = '<tr bgcolor=#E8E8FF><td class="fldname" valign=top>';
$bl1 = '<tr bgcolor=#FFFFFF><td class="fldname" valign=top>';
$ld = '</td><td> </td><td width=80% class="flddata">';
$el = "</td></tr>\n";
}
$i = 0;
foreach($_POST as $k => $v) {
if($htmlFormat) {
$v = str_replace("\n","<br>\n",$v);
}
if($i) {
$msg .= "$bl0$k:$ld$v$el";
} else {
$msg .= "$bl1$k:$ld$v$el";
}
$i = !$i;
}
if(file_exists("L10HC_API.php")) {
include("L10HC_API.php");
$vID = getVID();
if($htmlFormat) {
$msg .= "<tr><td colspan=3><br> <br></td></tr>\n<tr><td colspan=3 border=1>";
$creditStrAdd = ' & LevelTen Hit Counter';
} else {
$msg .= "\n\n";
$creditStrAdd = ' & LevelTen Hit Counter';
}
$msg .= getSessions($vID,$max_sessions,$Recipient_secured,$htmlFormat+1);
if($htmlFormat) {
$msg .= "</td></tr>\n";
} else {
}
}
$extraHeaders = "";
if($email != '') { $extraHeaders .= "From: \"".addslashes($realname)."\" <".$email.">\r\n"; }
if($realname != '') { $extraHeaders .= "Reply-To: $email\r\n"; }
if($htmlFormat == 'h') { $extraHeaders .= "Content-type: text/html\r\n"; }
if($Recipient_cc != '') { $extraHeaders .= "Cc: $Recipient_cc\r\n"; }
if($Recipient_bcc != '') { $extraHeaders .= "Bcc: $Recipient_bcc\r\n"; }
$success = 1;
$success = mail($Recipient,$subject,$msg,$extraHeaders);
if(!$success && $L10_LIBLoaded) {
log_event("Unsuccesful Email Attempt: $Recipient");
}
//print "mail($Recipient,$subject,$msg,$extraHeaders)";
//print "$msg";
header("Location: $redirect");
?>