GregL83 Posted June 22, 2006 Share Posted June 22, 2006 Hello, I am adding a PHP form to mail script to my contacts page of my website. I used a script generator from thesitewizard.com; however, I am getting an error message when I try and test it out. The message is as follows:"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."I can't find the error log or seem to be able to fix the problem. My web host is powweb and they have: PHP4 & PHP5 w/Zend Optimizer, Perl5, Sendmail listed as supported software.here is my .php file's code:<?$mailto = 'Langla79@erau.edu' ;$subject = "YourScene Message" ;$formurl = "http://www.***.us/contact.html" ; //note I blanked out website for privacy, thanks$errorurl = "http://www.***.us/contact_error.html" ;$thankyouurl = "http://www.***.us/contact_thanks.html" ;$uself = 0;$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;$name = $_POST['name'] ;$email = $_POST['email'] ;$comments = $_POST['comments'] ;$http_referrer = getenv( "HTTP_REFERER" );if (!isset($_POST['email'])) {header( "Location: $formurl" );exit ;}if (empty($name) || empty($email) || empty($comments)) {header( "Location: $errorurl" );exit ;}if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {header( "Location: $errorurl" );exit ;}if (get_magic_quotes_gpc()) {$comments = stripslashes( $comments );}$messageproper ="This message was sent from:\n" ."$http_referrer\n" ."------------------------------------------------------------\n" ."Name of sender: $name\n" ."Email of sender: $email\n" ."------------------------- COMMENTS -------------------------\n\n" .$comments ."\n\n------------------------------------------------------------\n" ;mail($mailto, $subject, $messageproper,"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );header( "Location: $thankyouurl" );exit ;?>Here is my code from the form:<form action="data/contact.php" method="post" name="Comments" id="Comments"><div align="center"><p><span class="style3">Full Name:</span><input name="name" type="text" id="full_name" maxlength="25"><span class="style3">Email:</span><input name="email" type="text" maxlength="25"></p><p><span class="style3">Message</span><br><textarea name="comments" cols="50" rows="7"></textarea></p></div></label><label> </label><div align="center"><input name="Submit" type="submit" value="Send"><input type="reset" name="Submit2" value="Reset"></label></div><label></label></form></td>PLEASE HELP!!!! Thank you for your time! Quote Link to comment https://forums.phpfreaks.com/topic/12639-php-form-to-mail-issues/ Share on other sites More sharing options...
cmgmyr Posted June 22, 2006 Share Posted June 22, 2006 Try just changing this:[code]mail($mailto, $subject, $messageproper,"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );[/code]to this[code]mail($mailto, $subject, $messageproper,"From: \"$name\" <$email>);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12639-php-form-to-mail-issues/#findComment-48532 Share on other sites More sharing options...
legohead6 Posted June 22, 2006 Share Posted June 22, 2006 [!--quoteo(post=386902:date=Jun 22 2006, 12:28 PM:name=cmgmyr)--][div class=\'quotetop\']QUOTE(cmgmyr @ Jun 22 2006, 12:28 PM) [snapback]386902[/snapback][/div][div class=\'quotemain\'][!--quotec--]Try just changing this:[code]mail($mailto, $subject, $messageproper,"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );[/code]to this[code]mail($mailto, $subject, $messageproper,"From: \"$name\" <$email>);[/code][/quote]ya simple is sometimes better! Quote Link to comment https://forums.phpfreaks.com/topic/12639-php-form-to-mail-issues/#findComment-48537 Share on other sites More sharing options...
cmgmyr Posted June 22, 2006 Share Posted June 22, 2006 Yeah...it's an easy debugger...take out all of the extra crap that you don't really need. If it works you are good and start adding stuff back on, if it doesn't, leave that part simple and look at something else. Quote Link to comment https://forums.phpfreaks.com/topic/12639-php-form-to-mail-issues/#findComment-48539 Share on other sites More sharing options...
GregL83 Posted June 22, 2006 Author Share Posted June 22, 2006 I came up with the same error....thanks for the attempt Quote Link to comment https://forums.phpfreaks.com/topic/12639-php-form-to-mail-issues/#findComment-48540 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.