stuartsparks Posted April 13, 2010 Share Posted April 13, 2010 Hi to all you clever peeps at PHP Freaks. This is a great site and i think it's brilliant where everyone is helping everyone else out :-) I think i've gone blind, i can't see what (probably very simple) error i have in my code: <html> <head> <title>Thanks for sending in your comments. We really appreciate your feedback</title> </head> <body> <h2>If you have requested a reply, then we shall email you within the next 24hours</h2> <?php ini_set("display_errors", "1"); error_reporting(E_ALL); $visitors_name = $_POST['VisitorsName']; $visitors_email = $_POST['VisitorsEmail']; $reply_requested = $_POST['ContactVisitor']; $visitors_comments = $_POST[ 'VisitorComments'; $emailto = '[email protected]'; $subject = 'Visitor Comments From Website'; echo '<br />'; echo '<br />'; echo 'Thanks for using this form.<br />'; echo '<br />'; echo 'Your Name is ' . $visitors_name; echo '<br />'; echo 'Your Email is ' . $visitors_email; echo '<br />'; echo 'And you have answered ' . $reply_requested . ' to requesting a reply'; echo '<br />'; echo 'Your comments on our site are - ' . $visitors_comments; $msg = 'The Visitors Name is ' . $visitors_name . ' and the their email is ' . $visitors_email . ' and in response to requesting a reply back then answered - ' . $visitors_comments . ' and their comments on our site are - ' . $visitors_comments; echo '<br />'; echo '<br />'; echo $msg; mail($emailto, $subject, $msg, 'From:[email protected]'); echo 'Email Sent'; ?> </body> </html> It's just a simple bit of code for people to enter comments on one of our websites. But when we hit submit on the previous html page, I just get the internal server error 500 page. Please could someone point out my foolishness. Many Thanks Stu Quote Link to comment https://forums.phpfreaks.com/topic/198367-php-page-failing-without-an-error-as-to-why-simple-mail-send/ Share on other sites More sharing options...
void Posted April 13, 2010 Share Posted April 13, 2010 for starters, $visitors_comments = $_POST[ 'VisitorComments'; Quote Link to comment https://forums.phpfreaks.com/topic/198367-php-page-failing-without-an-error-as-to-why-simple-mail-send/#findComment-1040878 Share on other sites More sharing options...
Pikachu2000 Posted April 13, 2010 Share Posted April 13, 2010 The only parse error is that you're missing a closing ] brace here: $visitors_comments = $_POST[ 'VisitorComments'; Quote Link to comment https://forums.phpfreaks.com/topic/198367-php-page-failing-without-an-error-as-to-why-simple-mail-send/#findComment-1040879 Share on other sites More sharing options...
stuartsparks Posted April 13, 2010 Author Share Posted April 13, 2010 Thanks Guys! I knew i'd missed something simple! Cheers Stu Quote Link to comment https://forums.phpfreaks.com/topic/198367-php-page-failing-without-an-error-as-to-why-simple-mail-send/#findComment-1040881 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.