syntax - What's wrong with this PHP email form script? -



syntax - What's wrong with this PHP email form script? -

<?php $name = $_post['name'] ; $email = $_post['email'] ; $reason = $_post['dropdown'] ; $message = $_post['message'] ; mail("user@example.com", "cwsdesigns form", "you have received new message. name: " . $name . " from: " . $email . " purchasing: " . $reason . " message: ". $message ."); ?>

i error message

parse error: syntax error, unexpected $end, expecting t_variable or t_dollar_open_curly_braces or t_curly_open in /home/u161219738/public_html/contact.php on line 13

i don't know php. know there errors basic , there other errors in script.

you can place variables within double quoted block, without worry. code had closing quotes in wrong place, , modified code did well, seek this.

<?php $name = $_post['name'] ; $email = $_post['email'] ; $reason = $_post['dropdown'] ; $message = $_post['message'] ; mail("user@example.com", "cwsdesigns form", "you have received new message. name: $name from: $email purchasing: $reason message: $message"); ?>

php syntax

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -