43 posts
  • 6 Years of Membership
  • Collector Level 3
  • United States
sunschild57
says

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!

2541 posts
  • Affiliate Level 2
  • Author Level 2
  • Collector Level 3
  • United States
+9 more
CreatingDrew
says
Please wrap your code in code tags or better yet a link to pastie.org. In addition add this to the top of your page for debugging purposes:

<?php ini_set("display_errors", "1");
error_reporting(E_ALL); 
?>

2036 posts Quality Manager
  • Affiliate Level 2
  • Author Level 4
  • Collector Level 4
  • Envato Team
+14 more
jremick
Envato team
says

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.

26 posts
  • 6 Years of Membership
  • Author Level 2
  • Collector Level 1
  • Exclusive Author
+1 more
ominiom
says

Are you sure you’ve set up sendmail on your server?

43 posts
  • 6 Years of Membership
  • Collector Level 3
  • United States
sunschild57
says

...trying to understand pastie

by
by
by
by
by
by