468,786 Members | 1,755 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,786 developers. It's quick & easy.

Keep Getting unexpected T_VARIABLE error

ok I keep getting this error:

Expand|Select|Wrap|Line Numbers
  1. Parse error: syntax error, unexpected T_VARIABLE in /home/illuzion/public_html/BAMF/contactus.php on line 38
  2.  
and this error is possibly on other lines could someone please help me out with this it is for a contact form for a webpage that I am making for a class project but I decided to add in this contact form....

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3. include("global.inc.php"); 
  4. $errors=0; 
  5. $error="We're sorrry, we encountered some errors when processing your form, please go back and try again.<ul>"; 
  6. pt_register('POST','Name'); 
  7. pt_register('POST','Email'); 
  8. pt_register('POST','Feedback');
  9. pt_register('POST','Enquiry Type');  
  10. $enquiry=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $enquiry); 
  11.  
  12. /* begin general error checking */ 
  13.  
  14. if($name=="Full Name Here") // checks to see if there is a full name entered
  15. $errors=1; 
  16. $error.="<li>You did not fill in the Name field and it is required.";
  17. if($email=="Your Email Here") // checks to see if there is a email entered 
  18. $errors=1; 
  19. $error.="<li>You did not fill in the E-mail field and it is required."; 
  20. if($enquiry=="Place your Enquiry Here") // checks to see if there is any feedback entered 
  21. $errors=1; 
  22. $error.="<li>You did not fill in any feedback and it is required."; 
  23. if($enquirytype=="Please choose one of the following...") // checks to see if there is any feedback entered 
  24. $errors=1; 
  25. $error.="<li>You did not select a type of enquiry please go back and select one "; 
  26. if($errors==1) echo $error;   // echoes the errors if there are any 
  27. else{
  28. $mailContent="--------SUPPORT REQUEST--------\n" 
  29.             ."Name: ".$name."\n"
  30.         ."E-Mail: "$email."\n
  31.         ."Enquiry Type: "$enquirytype."\n"
  32.         ."Enquiry: "$enquiry."\n" 
  33.  
  34. //---------------------------------- 
  35. $toAddress="support@bamf.dunnoscape.sooch.info"; /* change this! */ 
  36. $subject="Your Support Request at BAMF'"; /* change this! */ 
  37. $recipientSubject="BAMF's Contact Form"; /* change this! */ 
  38. $receiptMessage = "Thank you ".$name." for your enquiry at BAMF! A BAMF staff member will review your request and respond to your request if needed. \n\n\nHere is what you submitted to us:\n\n"  
  39.             ."Name: ".$name."\n"
  40.         ."E-Mail: "$email."\n
  41.         ."Enquiry Type: "$enquirytype."\n"
  42.         ."Enquiry: "$enquiry."\n"
  43.  
  44. //---------------------------------- 
  45. mail($email, $subject, $receiptMessage,"From:$toAddress"); 
  46. //---------------------------------- 
  47. mail($toAddress,$recipientSubject,$mailContent,"From:$email");  
  48. <!-- redirect user to the thanks page --> 
  49. <script type="text/javascript"> 
  50. window.location="http://bamf.dunnoscape.sooch.info/index.htm"; 
  51. </script> 
  52.  
  53. <!-- Do not change anything below this line --> 
  54.  
  55. <?php  
  56. ?> 
  57.  
Jan 13 '08 #1
7 2099
ak1dnar
1,584 Expert 1GB
Close the lines with double quotes, and use the concatenation operator [dot] on both beginning and end of the variable.
Expand|Select|Wrap|Line Numbers
  1.      ."E-Mail: ".$email."\n"

REMOVED, "please help!" from the thread title. please don't use it again.
Jan 13 '08 #2
thank you for the help I do appreciate it and I apologize for the title.

*EDIT*

Now I am gretting the same error on line 43

[PHP]Parse error: syntax error, unexpected T_VARIABLE in /home/illuzion/public_html/BAMF/contactus.php on line 43[/PHP]
Jan 13 '08 #3
Markus
6,050 Expert 4TB
I think you need to add a semi-colon to the end of line 40.
Jan 13 '08 #4
ok that fixed that one but GRRR now another



[PHP]Parse error: syntax error, unexpected '<' in /home/illuzion/public_html/BAMF/contactus.php on line 56[/PHP]

though that is supposed to be there for that is a comment.
Jan 13 '08 #5
Markus
6,050 Expert 4TB
You need to do
[php]
?>
[/php]
after line 55

:P
Jan 13 '08 #6
thank you so much I hate wehn I miss little things like that lol! well the script now works thanks to you guys! thanks again!
Jan 13 '08 #7
Markus
6,050 Expert 4TB
thank you so much I hate wehn I miss little things like that lol! well the script now works thanks to you guys! thanks again!
Happens to everyone :)

Post back whenever you need some help!
Jan 13 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by mooneater | last post: by
6 posts views Thread by Ehartwig | last post: by
1 post views Thread by mdouble | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.