hmnnn...yeah I didn't think it should, but right after I changed the mx record, my mail() script stopped working (posted below) - if anyone see's anything wrong with this script, please let me know - it did work at one point
<?
//email handling form for contact form, resume form, and support form
//contact form emails sales contact info
//resume form emails name/email/phone and resume attachment
//support form not created yet, will email image/screnenshot/etc.,
$path="Gnossos Software::Contact Us";
include ("files/header.php");
include ("files/verify.php");
//to handle standard contact form
if(strstr($_SERVER['HTTP_REFERRER'], 'contact.php')){
$subject = "SALES, subject: " . $_POST['subject'];
$to = "blank@blank.com";
if(!verify_email($_POST['email'])){
echo "bad email";
exit;
}
//if(!verify_phone(stripslashes($_POST['phone']))){
// echo "bad phone number";
// exit;
//}
foreach ($_POST AS $key => $value){
$message .= $key."=".$value."\n";
}
$headers = "From: $_POST['email']";
} else {
//this handles both support and resume submission as both involve file attachments
//to handle resume submission form
if(strstr($_SERVER['HTTP_REFERRER'], 'resume.php')){
$subject = "RESUME, subject: " . $_POST['name'];
$to = "blank@blank.com";
}
//to handle support form
if(strstr($_SERVER['HTTP_REFERRER'], 'support.php')){
$subject = "SUPPORT: subject: ";
$to = "blank@blank.com";
if(!verify_phone(stripslashes($_POST['phone']))){
echo "bad phone number";
exit;
}
}
if(!verify_email($_POST['email'])){
echo "bad email";
exit;
}
$from = stripslashes($_POST['name'])."<".stripslashes($_POST['email']).">";
foreach ($_POST AS $key => $value){
$message .= $key."=".$value."\n";
}
$tmp_name=$_FILES['file']['tmp_name'];
$type = $_FILES['file']['type'];
$name = $_FILES['file']['name'];
$size = $_FILES['file']['size'];
$headers = "From: $_POST['email']";
if (file_exists($tmp_name)){
if(is_uploaded_file($tmp_name)){
$file = fopen($tmp_name, 'rb');
$data = fread($file, filesize($tmp_name));
fclose($file);
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
$data = chunk_split(base64_encode($data));
$message .= "--{$mime_boundary}--\n" .
"Content-Type: {$type};\n" .
" name=\"{$name}\'\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data ."\n\n" .
"--{$mime_boundary}--\n";
}
}
}
echo "<div id=\"content\">";
echo "<div id=\"leftcont\">";
if(mail($to, $subject, $message, $headers)){
echo "<h4 style=\"text-align:center\">Your message was sent, someone will contact you shortly. <br />
You will now be redirected to the home page...</h4>";
//sleep(100);
//header("Location: [url]http://69.36.167.110/test/testing.php[/url]");
//exit;
} else {
echo "<h4 style=\"text-align:center\">Your message failed, please contact <a
href=\"mailto:blank@blank.com\">the
webmaster</a><br />You will now be redirected to the home page...</h4>";
//sleep(100);
//header("Location: [url]http://69.36.167.110/test/testing.php[/url]");
//exit;
}
echo "</div><!--end leftcont-->";
include ("files/footer.html");
?>
ok, I just threw a test statement into the first bit there (e.g., the if contact.php) and I realized it's not getting into the if statement at all and just proceeding to the mail statement (which succeeds with blank information). I swear though that I haven't changed those at all - just wondering what I can do (I guess maybe include a hidden field in each form to specify which one it will be).
THanks !
ok...answered my own question, used a hidden field in the various forms to determine the correct code portion to use (don't know why the string comparison stopped working). Question, would it be more efficient to use a switch statement then what is currently there?