i wrote a custom PHP script last year and everything worked perfectly... recently my webserver upgraded to PHP 5 and now my script doesn't work properly.
what the script does is: users fill out info and optionally can upload images, the user receives and email receipt of all the data they just submitted, and i'm suppose to receive their information in my email.
what still works is that the user will receive their receipt and the images are uploaded to the designated "client_uploads " folder, and i never receive the submitted information in my email address. but it doesn't really make sense to me because when i fill out the form, it does send and will eventually lead me to the thank you page, which according to the script below, will only be visible if the user receives the email and i receive the email... but i never receive the email... *scratches head*
my script is quite long, so i'm cut out parts that aren't important:
[PHP]<?php
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- FILE UPLOADS
$datafiletext = $_POST["datafilete xt"];
$datafiletextcl ass2 = $_POST["datafiletextcl ass2"];
$filedate = date("d-m-Y");
$uploadfolder = "../../../../client_uploads/";
$uploadfileA = $uploadfolder . 'MY_SITE-' . $filedate . '-' . basename($_FILE S['datafile']['name']);
if ($datafiletext != "")
{
$fileAuploaded = @move_uploaded_ file($_FILES['datafile']['tmp_name'], $uploadfileA);
$fileAuploaded ? FileB() :
header ("Location: http://www.mysite.com/english/restoration/assignmentform/error.html");
}
else
{
FileB();
}
function FileB()
{
$datafiletext = $_POST["datafilete xt"];
$datafiletextcl ass2 = $_POST["datafiletextcl ass2"];
$filedate = date("d-m-Y");
$uploadfolder = "../../../../client_uploads/";
$uploadfileB = $uploadfolder . 'MY_SITE-' . $filedate . '-' . basename($_FILE S['datafileclass2 ']['name']);
if ($datafiletextc lass2 != "")
{
$fileBuploaded = @move_uploaded_ file($_FILES['datafileclass2 ']['tmp_name'], $uploadfileB);
$fileBuploaded ? ClientMail() :
header ("Location: http://www.mysite.com/english/restoration/assignmentform/error.html");
}
else
{
ClientMail();
}
}
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- CLIENT MAIL
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PHP VARIABLES
function ClientMail() {
$name = $_POST["name"];
$addressline1 = $_POST["addresslin e1"];
$addressline2 = $_POST["addresslin e2"];
#a bunch of other variables
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND CLIENT EMAIL / MIME BOUNDARY
$mime_boundary = "----MY_SITE----".md5(time( ));
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-- HEADERS
$to = "$email";
$subject = "Assignment Form Online Submission Received";
$headers = "From: MY_SITE <reception@mysi te.com>\n";
$headers .= "Reply-To: MY_SITE <reception@mysi te.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mim e_boundary\"\n" ;
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- TEXT FORMAT START
$message = "--$mime_boundary\ n";
$message .= "Content-Type: text/plain; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "$name:\n\n This email is to confirm that MY_SITE has received your assignment via Assignment Form Online.\n\n";
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- HTML FORMAT START
$message .= "--$mime_boundary\ n";
$message .= "Content-Type: text/html; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "<html>\n";
$message .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:11px; color:#999999;\ ">\n";
$message .= "$name:\n\n This email is to confirm that MY_SITE has received your assignment via Assignment Form Online.\n\n";
$message .= "</body>\n";
$message .= "</html>\n\n";
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- HTML FORMAT END / FINAL BOUNDARY
$message .= "--$mime_boundary--\n\n";
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO CLIENT
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO CLIENT
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO CLIENT
$mail_sent = @mail( $to, $subject, $message, $headers );
$mail_sent ? MY_SITEMail() :
header ("Location: http://www.mysite.com/english/restoration/assignmentform/error.html");
}
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO MY_SITE
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO MY_SITE
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- SEND EMAIL TO MY_SITE
function MY_SITEMail() {
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PHP VARIABLES
$name = $_POST["name"];
$addressline1 = $_POST["addresslin e1"];
#a bunch of other variables
$ftpuploadfolde r = "ftp://login:password@ mysite.com:21//client_uploads/";
$ftpfileA = 'MY_SITE-' . $filedate . '-' . $datafiletext;
$ftpfileB = 'MY_SITE-' . $filedate . '-' . $datafiletextcl ass2;
# -=-=-=- MY_SITE'S EMAIL HEADERS
$imageemail = "MY_SITE <reception@mysi te.com>";
$imagesubject = "Assignment Form Online Submission";
$imageheaders = "From: $name <$email>\n";
$imageheaders .= "Reply-To: $name <$email>\n";
$imageheaders .= "MIME-Version: 1.0\n";
$imageheaders .= "Content-Type: text/html; charset=UTF-8\n";
$imageheaders .= "Content-Transfer-Encoding: 8bit\n\n";
# -=-=-=- MY_SITE'S HTML (ONLY) EMAIL BODY
$imagemessage = "<html>\n";
$imagemessage .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#999999;\ ">\n";
$imagemessage .= "<br>\n";
$imagemessage .= "Bla Bla Bla\n\n";
$imagemessage .= "</body>\n";
$imagemessage .= "</html>\n\n";
# -=-=-=- SEND MY_SITE MAIL
mail($imageemai l, $imagesubject, $imagemessage, $imageheaders);
header ("Location: http://www.mysite.com/english/restoration/assignmentform/complete/");
}
?>[/PHP]
i'm concerned that server admins changed something (but i don't know what, other than upgrading PHP)... i'm really not amazingly strong at PHP, but i'm 100% certain that this script worked flawlessly and now it doesn't... i've contacted my host and they told me they're not web developers so essentially i'm on my own... would the new PHP version support older syntax?
i really hope someone can help me out here... i'm quite lost.