473,474 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parse error: syntax error, unexpected T_VARIABLE in LINE 27

2 New Member
I am gettin a error message on this script can someone help me. I can't see what is wrong. Thanks in advance for any help you can give me.
here is the error and code.

Parse error: syntax error, unexpected T_VARIABLE in /home/a4284579/public_html/contactformphp.php on line 27

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. /* Subject and Email Variables*/
  4.  
  5.     $emailSubject = 'Client Information Scripting!';
  6.     $webMaster = 'gravizdesign@live.com';
  7.  
  8. /*Gathering Data Variables*/
  9.  
  10.     $emailField = $_POST['email'];
  11.     $nameField = $_POST['name'];
  12.     $messageField = $_POST['message'];
  13.  
  14.     $body = <<<EOD
  15. <br><hr><br>
  16. Email: $email<br>
  17. Name: $name<br>
  18. Message: $message<br>
  19. EOD;
  20.  
  21.     $headers = "From: $email\r\n";
  22.     $headers .= "Content-type: text/html\r\n";
  23.     $success = mail($webMaster, $emailSubject, $body, $headers
  24.  
  25. /*    Results rendered as HTML */
  26.  
  27. $theResults = <<<EOD  
  28. <html>
  29. <head>
  30. <title>Thesiscomplete.ie - Thesis bounding made easy</title>
  31. <meta http-equiv="refresh" content"5;URL=http://thesiscomplete.ie/contactus.html">
  32. <style type="text/css">
  33. <!--
  34. body {
  35.     background-color: #444;
  36.     font-family: Verdana, Arial, Helvetica, sans-serif;
  37.     font-size: 16px;
  38.     font-style: normal;
  39.     line-height: normal;
  40.     font-weight: normal;
  41.     color: #fec001;
  42.     text-decoration: none;
  43.     padding-top: 200px;
  44.     margin-left: 200px
  45.     width: 800px
  46. }
  47. -->
  48. </style>
  49. </head>
  50.  
  51. <div>
  52. <div align="centre">Your email will be answered as soon as possible. You will be returned to Thesiscomplete in a few seconds!</div>
  53. </body>
  54. </html>
  55. EOD;
  56. echo "$theResults";
  57.  
  58. ?>
Apr 1 '10 #1
4 3305
code green
1,726 Recognized Expert Top Contributor
It means there is a syntax error on line 27 (or possibly earlier).
Enclose in CODE tags and tell us which is line 27
Apr 1 '10 #2
Graviz
2 New Member
line 27 is the following $theResults = <<<EOD
Apr 1 '10 #3
code green
1,726 Recognized Expert Top Contributor
The error is on this line
Expand|Select|Wrap|Line Numbers
  1. $success = mail($webMaster, $emailSubject, $body, $headers
  2.  
Apr 1 '10 #4
Atli
5,058 Recognized Expert Expert
There also seem to be spaces following the "<<<EOD" on the line you indicated. You need to remove them. - Nothing can follow the starting delimiter of an Heredoc string. Not until the next line, that is.
Apr 1 '10 #5

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

Similar topics

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...
2
by: aamer | last post by:
can anyone please help me, im getting a dumb: Parse error: syntax error, unexpected T_VARIABLE in /home/jeddah/public_html/lomar/cart/remove.php on line 5 in the following file, <?php...
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 ...
1
epots9
by: epots9 | last post by:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/xxx.php on line xxx I get that message when i try to run my...
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. ...
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...
4
by: needhelp08 | last post by:
I am getting the error Parse error: syntax error, unexpected T_VARIABLE on line 4 but I can't seem to find what is wrong. Could someone please help. <?php $conn = @mysql_connect("localhost",...
5
praclarush
by: praclarush | last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
2
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.