PDA

View Full Version : Correct PHP for VERSION 4.3.1??? My php is not sending!


volcomp
02-11-2005, 07:09 PM
Hi all...

I was checking some earlier PHP scripts I had used in a few different websites and noticed it worked fine on some servers and didn't work on a server that used PHP version 4.3.1!

Is there something I can do to fix my code? Is something missing?

here it is...



<?php
$ToEmail = "me@name.com";
$ToName = "Jodi";
$ToSubject = "ELITE Service Request Form";
$EmailBody = "\n\n-----Contact Information-----

$FirstName = $_POST['FirstName'];
$Email = $_POST['Email'];
$Phone = $_POST['Phone'];
$Fax = $_POST['Fax'];
$Street = $_POST['Street'];
$Company = $_POST['Company'];

\n\n-----Service Information-----

$Type = $_POST['Type'];
$Doforyou = $_POST['Doforyou'];
$Contactyou = $_POST['Contactyou'];
$Hearaboutus = $_POST['Hearaboutus'];
$ToComments = $_POST['ToComments'];
\n\n";

$EmailFooter="\nIf you feel that you recieved this e-mail by accident please contact us at ...";
$Message = $EmailBody.$EmailFooter;
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <info@name.ca>");
?>



Help!

volcomp
02-11-2005, 07:29 PM
Should I be defining those variable at the top of my script or something?

volcomp
02-11-2005, 08:31 PM
Got it... Heres the new code: (Share the wealth)



<?php
$ToEmail = "info@name.com";
##$ToName = "Your Name";
$ToSubject = "Service Request Form";

// --- My variables

$FirstName = $_POST['FirstName'];
$Email = $_POST['Email'];
$Phone = $_POST['Phone'];
$Fax = $_POST['Fax'];
$Street = $_POST['Street'];
$Company = $_POST['Company'];
$Type = $_POST['Type'];
$Doforyou = $_POST['Doforyou'];
$Contactyou = $_POST['Contactyou'];
$Hearaboutus = _POST['Hearaboutus'];
$ToComments = $_POST['ToComments'];

// ---

$EmailBody = "\n\n-----Contact Information-----
\n\nSent By: $FirstName
\nSenders Email: $Email
\nSenders Phone: $Phone
\nSenders Fax: $Fax
\nSenders Address: $Street
\nSenders Company: $Company
\n\n-----Service Information-----
\n\nService Type: $Type
\nWhat can we do for you: $Doforyou
\nHow can we contact you: $Contactyou
\nHow did you hear about us: $Hearaboutus
\n\nMessage Sent:\n\n$ToComments
\n\n";

$EmailFooter="\nIf you feel that you recieved this e-mail by
accident please contact us at ...]";
$Message = $EmailBody.$EmailFooter;
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");
?>