Let me allaborate, I am getting the email but i am getting the wrong information to my email when i submit on the form i am getting this info ;
$body = 'Dear '.$name.',<br><br>';
$body .= 'Thankyou for submitting your interest in business for sale at Elite Property Group.<br>';
$body .= 'We have captured your details for the business you are interested in and will be contacting you shortly.
when i should be getting the info that has been submitted such as;
userid, name, email, phone, enquiry, reference, status) VALUES ('', '$name', '$email', '$phone', '$enquiry', '$reference', 'open')";
hope that makes sense and you can help me out?
It came up with the error, oops, something went wrong'
actually this was the form and code i needed it on;
PHP Code:
<?php
require_once('db.inc.php');
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$phone = ereg_replace("[^0-9+ ]", "", $_POST['phone']);
$enquiry = ereg_replace("\n", "<br>", $_POST['enquiry']);
$reference = $_POST['reference'];
echo $biz_id;
if (empty($name) || empty($email) || empty($phone) || empty($enquiry)) {
echo 'Please fill up all the forms.';
} elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
echo 'Email is not validate.';
} else {
$query = "INSERT INTO mailing_list (userid, name, email, phone, enquiry, reference, status) VALUES ('', '$name', '$email', '$phone', '$enquiry', '$reference', 'open')";
mysql_query($query) or die("MySQL Error :" . mysql_error());
$eol = "\r\n";
$title = 'BUSINESS GROUP (Enquiry)';
$email = 'info@email.com';
$headers = 'From: Business Groups<info@anotheremail.com>'.$eol;
$headers .= 'Content-Type: text/html; charset=ISO-8859-1 '.$eol;
$headers .= 'MIME-Version: 1.0 '.$eol;
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;
$body = 'Dear '.$name.',<br><br>';
$body .= 'Thankyou for submitting your interest in business for sale at Elite Property Group.<br>';
$body .= 'We have captured your details for the business you are interested in and will be contacting you shortly.<br><br>';
$body .= 'Warm Regards,<br><br>';
$body .= 'Business Group<br>';
$body .= 'www.website.com<br>';
$body .= 'www.website2.com';
mail($email, $title, $body, $headers);
echo 'Thank you, we will get back to you as soon as possible.<br>';
}
}
// Add this code to check if the mail function was executed.
if(!$mail_it) {
echo 'Oops, something went wrong.';
} else {
echo 'Mail sent.';
}
?>
Bookmarks