Hi guys,
I have an enquiry form on my website that works fine on a Windows server but not on a Linux server (nothing enters my email box?).
Here's the code below (apologies TGML isn't used - the submit button wasn't visible when I went to preview), any help would be greatly appreciated!!!
Thanks,
Mark
I have an enquiry form on my website that works fine on a Windows server but not on a Linux server (nothing enters my email box?).
Here's the code below (apologies TGML isn't used - the submit button wasn't visible when I went to preview), any help would be greatly appreciated!!!
Thanks,
Mark
Code:
<?php
ini_set("sendmail_from", "root@mywebsite.co.uk");
if(isset($_POST['submit_x'])){
// get posted data into local variables
if(isset($_POST['Title'])){$Title = $_POST['Title'];}
if(isset($_POST['Name'])){$Name = $_POST['Name'];}
$tmp = $_POST['AddressofPropertytobeSold'];
if (strlen($tmp)>0)
$AddressofPropertytobeSold = $tmp;
else
$AddressofPropertytobeSold ="--";
$tmp=$_POST['PostCode'];
if (strlen($tmp)>0)
$PostCode =$tmp;
else
$PostCode ="--";
if(isset($_POST['TypeofProperty'])){$TypeofProperty =
$_POST['TypeofProperty'];}
if(isset($_POST['time'])){$besttime =
$_POST['time'];}
if(isset($_POST['NumberofBedrooms'])){$NumberofBedrooms =
$_POST['NumberofBedrooms'];}
if(isset($_POST['ReasonforSelling'])){$ReasonforSelling =
$_POST['ReasonforSelling'];}
$tmp=$_POST['HowWouldyouPreferustoContactYou'];
if (strlen($tmp)>0)
$HowWouldyouPreferustoContactYou =$tmp;
else
$HowWouldyouPreferustoContactYou ="--";
$tmp=$_POST['EstimatedValueoftheProperty'];
if (strlen($tmp)>0)
$EstimatedValueoftheProperty =$tmp;
else
$EstimatedValueoftheProperty ="--";
if(isset($_POST['hear'])){$hear = $_POST['hear'];}
if(isset($_POST['email'])){$email = $_POST['email'];}
if(isset($_POST['addme'])){$addme = $_POST['addme'];}
//code for mail, preparing msgtext for mail
$subject = "Website Enquiry";
$msgtext="<html><head><title>Enquiry from
mywebsite.co.uk</title><style
TYPE=text/css>body{font-family:arial; font-size:3px;}</style>
</head><body><table border=0 cellspacing=2 cellpadding=2
width=70%><tr><td colspan=2 ><br><br>Lead
Details<BR> </td></tr><tr><td colspan='2' height='1'
bgcolor='#1F8992'></td></tr>";
if ($Title == "Other"){
$msgtext .= "<tr><td width=36%><B>Title</B></td><td>". $Title .
"</td></tr><tr><td width=36%><B>Name</B></td><td>". $Name .
"</td></tr>";
}
else{
$msgtext.="<tr><td width=36%><B>Name</B></td><td>". $Title . " " .
$Name . "</td></tr>";
}
$msgtext.="<tr><td><B>Address of Property to be
Sold</B></td><td>".$AddressofPropertytobeSold."</td></tr><tr><td><B>Post
Code</B></td><td>".$PostCode."</td></tr><tr><td><B>Type of
Property</B></td><td>".$TypeofProperty."</td></tr><tr><td><B>Number of
Bedrooms</B></td><td>".$NumberofBedrooms."</td></tr><tr><td><B>Reason
for
Selling</B></td><td>".$ReasonforSelling."</td></tr><tr><td><B>Telephone
number
</B></td><td>".$HowWouldyouPreferustoContactYou."</td></tr><tr><td><B>Email</B></td><td>".$email."</td></tr><tr><td><B>Realistic
value of the
property</B></td><td>".$EstimatedValueoftheProperty."</td></tr>
<tr><td><B>How did you hear about us</B></td>
<td>".$hear."</td>
</tr>
<tr><td><B>Best time to call </B></td>
<td>".$besttime."</td>
</tr>
<tr><td
colspan='2'
height='1' bgcolor='#1F8992'></td></tr><tr><td colspan=2> <TR><TD
colspan=2> </table></body></html>";
$to = "info@mywebsite.co.uk";
$from = $email; //"enquiries@mywebsite.co.uk";
$header = "From: $from\nReply-To: $from\n";
$header .= "MIME-Version: 1.0\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$body = $msgtext;
@mail($to, $subject, $body, $header, "-f".$_REQUEST[email]);
}
?>