43 posts
  • Bought between 50 and 99 items
  • Has been a member for 5-6 years
  • 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
  • United States
  • 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 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
+4 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); 
?>

2016 posts Review Manager
  • Envato Staff
  • Has been a member for 5-6 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
+7 more
jremick Staff 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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 and 100 dollars
  • United Kingdom
ominiom says

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

43 posts
  • Bought between 50 and 99 items
  • Has been a member for 5-6 years
  • United States
sunschild57 says

...trying to understand pastie

by
by
by
by
by
by