this question has answer here:
- php parse/syntax errors; , how solve them? 12 answers
parse error: syntax error, unexpected 'message' (t_string), expecting variable (t_variable) or '$' in /home/u718296514/public_ html/support.php on line 1
thats problem,my code feedback function. php code:
<?php $action=$_request['action']; if ($action=="") /* display contact form */ { ?> <form action="index.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="action" value="submit"> name:<br> <input name="name" type="text" value="" size="30"/><br> email:<br> <input name="email" type="text" value="" size="30"/><br> message:<br> <textarea name="message" rows="7" cols="30"></textarea><br> <input type="submit" value="send"/> </form> <?php } else /* send submitted data */ { $name=$_request['name']; $email=$_request['email']; $message=$_request['message']; if (($name=="")||($email=="")||($ message=="")) { echo "all fields required, please fill <a href=\"\">the form</a> again."; } else{ $from="from: $name<$email>\r \nreturn-path: $email"; $subject="message sent using contact form"; mail("name@website.com", $ subject, $message, $from); echo "email sent!"; } } ?>
hope correct it
you put $ subject (space between dollar sign , variable name) in mail() function parameter
change
mail("name@website.com", $ subject, $message, $from);
to
mail("name@website.com", $subject, $message, $from);
Comments
Post a Comment