I bought a template that was advertised to have a working contact form. The instructions said that all I had to do was change the e-mail address. I did this and the form doesn’t work. I e-mailed the seller but got no response.
This is the error message I get when I test the form: The server encountered an unexpected condition which prevented it from fulfilling the request. The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log.
This is the contact form Php:
<?PHP $to = “mediacovenant@gmail.com”; $subject = “Results from your Request Info form”; $headers = “From: Form Mailer”; $forward = 0; $location = ””;
$date = date (“l, F jS, Y”); $time = date (“h:i A”);
$msg = “Below is the result of your feedback form. It was submitted on $date at $time.\n\n”;
if ($_SERVER[‘REQUEST_METHOD’] == “POST”) { foreach ($_POST as $key ?> $value) { $msg .= ucfirst ($key) .” : ”. $value . ”\n”; } } else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) .” : ”. $value . ”\n”; } }
mail($to, $subject, $msg, $headers); if ($forward == 1) { header (“Location:$location”);
} else { echo “ ”; }
?>
Can anyone tell me why this is not working! Thanks!
- Community Moderator
- United States
- Was featured in a podcast
- Attended a Community Meetup
- Author had a Free File of the Month
- Bought between 50 and 99 items
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
- Contributed a Tutorial to a Tuts+ Site
<?php ini_set("display_errors", "1");
error_reporting(E_ALL);
?>
- Envato Staff
- Has been a member for 4-5 years
- Attended a Community Meetup
- Australia
- Beta Tester
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
I don’t know if this is the answer to your specific problem but the contact form I’ve used in my templates uses PHP 5 . I’ve had several people contact me having problems with the contact form and the problem was their web server was using PHP 4 .
For the people using my contact form, they just had to download the PHP 4 version of of the PHPMailer class.
Anyway, post the code using pastie like Drew said and we should be able to help you out.
Are you sure you’ve set up sendmail on your server?
...trying to understand pastie
