I have a very simple contact form with a php script which when filled in sends an email to the client. For some reason I cannot get this script to work, it runs fine on another server but not on this. I think this maybe because of the server config but my knowledge is poor on servers so any help would be grateful.
Heres the php
$post = $_POST;
if(strlen($post['name'])){ $name = htmlentities($post['name']);};
if(strlen($post['email'])){ $email = htmlentities($post['email']);};
if(strlen($post['enquiry'])){ $enquiry = htmlentities($post['enquiry']);};
if($_POST['hidden']){
$headers = "From: sites.co.uk \\r\
";
//$headers .= "Reply-To: site.co.uk \\r\
";
//$headers .= "Content-type: text/plain; charset=iso-8859-1 \\r\
";
$subject = "A comment from the vistor page on site.co.uk";
$message = "Name: $name \\r\
";
$message .= "Email address: $email \\r\
";
$message .= "comments: $enquiry \\r\
";
if(mail("user@googlemail.com", $subject,"test",$headers)){
echo 'its worked';//The mail() function is returning true
}
//mail("user@site.co.uk", $subject, $message, $headers );
$post['success']= 'yes';
}
?>
Here are the errors from the log file
[Mon Mar *8 21:30:19 2010] [error] [client 81.141.46.86] FastCGI: comm with (dynamic) server "/var/www/fcgi/php-cgi" aborted: (first read) idle timeout (30 sec)
[Mon Mar *8 21:30:19 2010] [error] [client 81.141.46.86] FastCGI: incomplete headers (0 bytes) received from server "/var/www/fcgi/php-cgi"
[Mon Mar *8 21:44:44 2010] [error] [client 195.93.21.70] FastCGI: comm with (dynamic) server "/var/www/fcgi/php-cgi" aborted: (first read) idle timeout (30 sec)
[Mon Mar *8 21:44:44 2010] [error] [client 195.93.21.70] FastCGI: incomplete headers (0 bytes) received from server "/var/www/fcgi/php-cgi"
//ignore the header files as I have been messsing with them trying to debug.