...

View Full Version : Urgnt Help



pwilding
05-25-2011, 11:46 AM
Hi I am trying to create a simple quote/info request on our website

www.cpberry.com

but seem to be having major problems with it, when we submit the form we get the following error

'; $email=$_POST['email']; $name=$_POST['name']; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $name <$email>"; $subject='Message from the site'; $send_contact=mail($to,$subject,$message,$headers); if ($send_contact) header("Location: http://www.cpberry.com/thanks.html"); else echo "There was an error"; } ?>

The script I have used is as follows:

<?php
$to = 'aaronlee@cpberry.com';

if ($_POST['submit'])
{
$message='<html>
<head>
<title>Message from the Site</title>
</head>
<body>
<p>'.$_POST['message'].'</p>
</body>
</html>';
$email=$_POST['email'];
$name=$_POST['name'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $name <$email>";
$subject='Message from the site';
$send_contact=mail($to,$subject,$message,$headers);
if ($send_contact)
header("Location: http://www.cpberry.com/thanks.html");
else
echo "There was an error";
}
?>


Can anyone shed any light on this,

Thanks in advance

gvre
05-25-2011, 01:03 PM
It seems that php is not enabled. Check you web server's configuration.

tangoforce
05-25-2011, 01:56 PM
It's possible that its a file permission problem. If you're on linux try chmod'ing the file to 755. If you're on windows then it doesn't matter and its probably a misconfiguration in a config file somewhere.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum