nickfran Posted September 7, 2010 Share Posted September 7, 2010 Hey Everyone, I'm getting this error when I submit my contact form. Parse error: syntax error, unexpected $end in /home1/user/public_html/contact/process.php on line 22 I got this code from a video on youtube. If I made a mistake or TYPO please let me know. Thanks! Here's my code: <?php $emailSubject = 'Contact Form Submission'; $sendto = 'info@mydomain.com'; $nameField = $_Post['name']; $emilField = $_Post['email']; $phoneField = $_Post['phone']; $SubjectField = $_Post['subject']; $messageField = $_Post['message']; $body = <<<EOD <br><hl><br>This Form was submitted from the Domain.com contact page.<br> Name: $name<br> E-Mail: $email<br> Phone: $phone<br> Subject: $subject<br> Message: $message<br> BOD; $headers = "FROM: $email\r\n"; $headers .="Content-Type: text/html\r\n"; $success = mail($sendto, $emailSubject, $body, $headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/212727-parse-error-syntax-error-unexpected-end-in-home1userpublic_html/ Share on other sites More sharing options...
mikosiko Posted September 7, 2010 Share Posted September 7, 2010 BOD; should be EOD; Quote Link to comment https://forums.phpfreaks.com/topic/212727-parse-error-syntax-error-unexpected-end-in-home1userpublic_html/#findComment-1108112 Share on other sites More sharing options...
nickfran Posted September 8, 2010 Author Share Posted September 8, 2010 Ok, Thanks! Now it Submit's but I don't get any of the responses. I.E. I get an e-mail with Name: E-Mail: ETC... but no responses. Quote Link to comment https://forums.phpfreaks.com/topic/212727-parse-error-syntax-error-unexpected-end-in-home1userpublic_html/#findComment-1108918 Share on other sites More sharing options...
JasonLewis Posted September 9, 2010 Share Posted September 9, 2010 Because you're using two different variable names. $nameField = $_Post['name']; Then your trying to echo out $name in your e-mail message. Quote Link to comment https://forums.phpfreaks.com/topic/212727-parse-error-syntax-error-unexpected-end-in-home1userpublic_html/#findComment-1109057 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.