I was wondering if the format of an email could be changed for it to appear in a table or even with <br> in between? Where would i add this in the following code?
if (!isset($_POST['submit']) || $_SERVER['REQUEST_METHOD'] != "POST") {
exit("<p>You did not press the submit button; this page should not be accessed directly.</p>");
} else {
$exploits = "/(content-type|bcc:|cc:|document.cookie|onclick|onload|javascript|alert)/i";
$profanity = "/(list|of|sexual|or|profane|spam|words)/i";
$spamwords = "/(list|of|the|typical|spam|words)/i";
$bots = "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer)/i";
if (preg_match($bots, $_SERVER['HTTP_USER_AGENT'])) {
exit("<p>Known spam bots are not allowed.</p>");
}
foreach ($_POST as $key => $value) {
$value = trim($value);
if (empty($value)) {
exit("<p>Empty fields are not allowed. Please go back and fill in the form properly.</p>");
} elseif (preg_match($exploits, $value)) {
exit("<p>Exploits/malicious scripting attributes aren't allowed.</p>");
} elseif (preg_match($profanity, $value) || preg_match($spamwords, $value)) {
exit("<p>That kind of language is not allowed through our form.</p>");
}
$_POST[$key] = stripslashes(strip_tags($value));
}
if (!ereg("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,6})$",strtolower($_POST['email']))) {
exit("<p>That e-mail address is not valid, please use another.</p>");
}
$recipient = "myemail@domain.com";
$subject = "You have a new order";
$message = "Order Form: \n";
$message .= "Title: {$_POST['title']} \n";
$message .= "Forename: {$_POST['forename']} \n";
$message .= "Surname: {$_POST['surname']} \n";
$message .= "Home Address: {$_POST['haddress']} \n";
$message .= "Town: {$_POST['htown']} \n";
$message .= "Postcode: {$_POST['hpostcode']} \n";
$message .= "Time At Current Address: {$_POST['htime']} Years {$_POST['htime2']} \n";
$message .= "Billing Address: {$_POST['baddress']} \n";
$message .= "Town: {$_POST['btown']} \n";
$message .= "Billing Postcode: {$_POST['bpostcode']} \n";
$message .= "Occupation: {$_POST['jobtitle']} \n";
$message .= "Time With Present Employer: {$_POST['jobtime']} Years {$_POST['jobtime2']} \n";
$message .= "Marital Status: {$_POST['marital']} \n";
$message .= "Date of Birth: {$_POST['dob']}/{$_POST['dobm']}/{$_POST['doby']} \n";
$message .= "Telephone: {$_POST['telephone']} \n";
$message .= "Mobile: {$_POST['mobile']} \n";
$message .= "Previous Address: {$_POST['paddress']} \n";
$message .= "Town: {$_POST['ptown']} \n";
$message .= "Postcode: {$_POST['ppostcode']} \n";
$message .= "Time At Address: {$_POST['ptime']} Years {$_POST['ptimem']} \n";
$message .= "Second Previous Address: {$_POST['paddress2']} \n";
$message .= "Town: {$_POST['ptown2']} \n";
$message .= "Postcode: {$_POST['ppostcode2']} \n";
$message .= "Time At Address: {$_POST['ptime2']} Years {$_POST['ptimem2']} \n";
$message .= "Accomodation Type: {$_POST['accom']} \n";
$message .= "Occupation Type: {$_POST['occ']} \n";
$message .= "Proof of Address: {$_POST['proof']} \n";
$message .= "Date of Birth: {$_POST['dproof']}/{$_POST['dproofm']}/{$_POST['dproofy']} \n";
$message .= "E-mail: {$_POST['email']} \n";
$message .= "Country: {$_POST['country']} \n";
$headers = "From: Sacranie-Mobiles.co.uk <$recipient> \n";
$headers .= "Reply-To: <{$_POST['email']}>";
if (mail($recipient,$subject,$message,$headers)) {
echo "<p>Thank you! Your order has now been placed. We will be in touch shortly.</p>";
} else {
echo "<p>Sorry, there was an error and your mail was not sent. Please find an alternative method of contacting the webmaster.</p>";
}
}
?>
Any help would be appreciated.
Mod Edit: 31Jan07 - bpat1434