Hi guys! 🙂
I have a contact form which works perfectly wen i had it being linked to a blank mailer.php file with nothing but the php code, but now it gives me the following error when i have my own html added to the page:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\inetpub\vhosts\travelagent.ie\httpdocs\business\mailer.php:6) in C:\inetpub\vhosts\travelagent.ie\httpdocs\business\mailer.php on line 158
here is the contact page link: http://www.travelagent.ie/business/contact.html
And heres the mailer.php PHP code.
<?php session_start();
if(isset($POST['Submit'])) { if( $SESSION['chapcha_code'] == $POST['chapcha_code'] && !empty($SESSION['chapcha_code'] ) ) {
$youremail = 'jack.french@travelagent.ie';
$fromsubject = 'Business Travel Inquiry';
$title = $POST['title'];
$fname = $POST['fname'];
$lname = $POST['lname'];
$mail = $POST['mail'];
$address = $POST['address'];
$city = $POST['city'];
$phone = $POST['phone'];
$mpriority = $POST['mpriority'];
$subject = $POST['subject'];
$message = $POST['message'];
$to = $youremail;
$mailsubject = 'Message received from'.$fromsubject.' Contact Page';
$body = $fromsubject.'
The person that contacted you is called '.$fname.'
Company: '.$lname.'
Address: '.$address.'
Job Title '.$city.'
Phone Number: '.$phone.'
E-mail: '.$mail.'
Yearly Spend: '.$mpriority.'
Subject: '.$subject.'
Message:
'.$message.'
|---------END MESSAGE----------|';
echo "Thank you for contacting us, we will be in contact shortly!</a>";
mail($to, $subject, $body);
unset($_SESSION['chapcha_code']);
} else {
echo 'Sorry, you have provided an invalid security code';
}
} else {
echo "You must write a message. </br> Please go to <a href='/business/contact.html'>Contact Page</a>";
}
?>
Whats the problem, the email is still sending but i dont want the error message!
Can anyone help!?? 🙂