Sup everyone-
Could you guys look at my scripts and tell me what the heck am I doing wrong? I can’t get this PHP thing to work at all. I’m not getting any emails sent. I’ve looked over and searched my brains out on PHP, and still no luck for two days now. Help me please? I’m still a newbie at this thing.
My form is a flash form.
php script saved as a php3 file:
<?
$email_subject = '[E-mail Application]';
$email_to = '[email protected]';
$email_from_name = 'customername';
$email_from = 'customeremail';
$email_header = 'customerphone';
$email_footer = 'customercomment';
$email_redirect = '';
$valid_referer = array(
'charlotteshouses.com'
);
$is_good = false;
while(list($junk, $site) = each($valid_referer)) {
if (eregi($site.'/', $_SERVER['HTTP_REFERER'])) {
$is_good = true;
break;
}
}
if (!$is_good) {
echo "Error. Invalid referrer: '".$_SERVER['HTTP_REFERER']."'";
exit;
}
while(list($n, $v) = each($_POST)) {
switch(strtoupper($n)) {
// case 'TO':
// $email_to = $v;
// break;
case 'FROM':
$email_from = $v;
break;
case 'SUBJECT':
$email_subject = $v;
break;
case 'FROM_NAME':
$email_from_name = $v;
break;
case 'HEADER':
$email_header = $v;
break;
case 'FOOTER':
$email_footer = $v;
break;
case 'REDIRECT':
$email_redirect = $v;
break;
case 'SIGNATURE':
break;
case 'SUBMIT':
break;
default:
$email_body .= $n.' => '.$v."
";
break;
}
}
if ($email_header)
$email_body = $email_header."
".$email_body;
if ($email_footer)
$email_body = $email_body."
".$email_footer;
mail($email_to, $email_subject,
$email_body,
"From: \"".$email_from_name."\" <".$email_from.">
"
."Reply-To: \"".$email_from_name."\" <".$email_from.">
"
.'X-Mailer: RackNine_Mail_Program/' . phpversion());
if ($email_redirect) {
header("Location: ".$email_redirect);
exit();
}
?>