0

Parse error: syntax error, unexpected 'message' (T_STRING), expecting variable (T_VARIABLE) or '$' in /home/u718296514/public_ html/support.php on line 1
Thats my problem,my code is for feedback function. Php code:

<?php 
$action=$_REQUEST['action']; 
if ($action=="") /* display the 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 the submitted data */ { 
    $name=$_REQUEST['name']; 
    $email=$_REQUEST['email']; 
    $message=$_REQUEST['message']; 
    if (($name=="")||($email=="")||($ message=="")) { 
        echo "All fields are required, please fill <a href=\"\">the form</a> again."; 
    } else{ 
        $from="From: $name<$email>\r \nReturn-path: $email"; 
        $subject="Message sent using your contact form"; 
        mail("name@website.com", $ subject, $message, $from); 
        echo "Email sent!"; 
    } 
} ?>

Hope you correct it

noufalcep
  • 3,446
  • 15
  • 33
  • 51
  • these are the question that should never be asked here. Lacks personal effort: syntax errors? really? – STT LCU May 08 '15 at 10:24

1 Answers1

2

you put $ subject (space between dollar sign and variable name) in mail() function parameter

change

mail("name@website.com", $ subject, $message, $from);

to

mail("name@website.com", $subject, $message, $from);
noufalcep
  • 3,446
  • 15
  • 33
  • 51
Ayyanar G
  • 1,545
  • 1
  • 11
  • 24