I don't know very much PHP, but I'm trying to set up a survey for a friend. There is an html file with the form and a php file that sends an email. For some reason the php file just gives me the error:
Parse error: syntax error, unexpected '=' in /home/scott/public_html/rugby/contact.php on line 3
Here is the php file, I really can not see the problem. Please help, this is urgent!
Parse error: syntax error, unexpected '=' in /home/scott/public_html/rugby/contact.php on line 3
Here is the php file, I really can not see the problem. Please help, this is urgent!
| Code: |
| <?php
// get posted data into local variables $EmailFrom = "xxx@electrn.ca"; $EmailTo = "xxx@gmail.com"; $Subject = "SURVEY"; $Question1 = Trim(stripslashes($_POST['Question1'])); $Question1-Other = Trim(stripslashes($_POST['Question1-Other'])); $Question2 = Trim(stripslashes($_POST['Question2'])); $Question2-Other = Trim(stripslashes($_POST['Question2-Other'])); $Question3 = Trim(stripslashes($_POST['Question3'])); $Question4 = Trim(stripslashes($_POST['Question4'])); $Question4-Specify = Trim(stripslashes($_POST['Question4-Specify'])); $Question5 = Trim(stripslashes($_POST['Question5'])); $Question6 = Trim(stripslashes($_POST['Question6'])); $Question7 = Trim(stripslashes($_POST['Question7'])); $Question8 = Trim(stripslashes($_POST['Question8'])); $Question9 = Trim(stripslashes($_POST['Question9'])); $Question10 = Trim(stripslashes($_POST['Question10'])); $Question11 = Trim(stripslashes($_POST['Question11'])); $Question12 = Trim(stripslashes($_POST['Question12'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Question1: "; $Body .= $Question1; $Body .= "\n"; $Body .= "Question1-Other: "; $Body .= $Question1-Other; $Body .= "\n"; $Body .= "Question2: "; $Body .= $Question2; $Body .= "\n"; $Body .= "Question2-Other: "; $Body .= $Question2-Other; $Body .= "\n"; $Body .= "Question3: "; $Body .= $Question3; $Body .= "\n"; $Body .= "Question4: "; $Body .= $Question4; $Body .= "\n"; $Body .= "Question4-Specify: "; $Body .= $Question4-Specify; $Body .= "\n"; $Body .= "Question5: "; $Body .= $Question5; $Body .= "\n"; $Body .= "Question6: "; $Body .= $Question6; $Body .= "\n"; $Body .= "Question7: "; $Body .= $Question7; $Body .= "\n"; $Body .= "Question8: "; $Body .= $Question8; $Body .= "\n"; $Body .= "Question9: "; $Body .= $Question9; $Body .= "\n"; $Body .= "Question10: "; $Body .= $Question10; $Body .= "\n"; $Body .= "Question11: "; $Body .= $Question11; $Body .= "\n"; $Body .= "Question12: "; $Body .= $Question12; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> |
