473,396 Members | 1,895 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,396 software developers and data experts.

Parse error: syntax error, unexpected $end in "xxx line no 103"

Code given below
Expand|Select|Wrap|Line Numbers
  1. echo <<
  2. <style type="text/css">
  3. table, tr, td, th, tbody, TR, TD{
  4. font-family: Verdana;
  5. font-size: 8pt;
  6. font-size: 11; 
  7. color: #000000; 
  8. border-font-size: 11; 
  9. color: #000000;
  10. border-collapse: collapse;
  11. }
  12. </style>
  13. <table border="l" cellpadding="l" width="98%">
  14. <tr>
  15.     <td align="center" colspan="7" bgcolor="#999999"> $Current_Day_Name,$Current_Month_Name, $Current_Year
  16. </tr>
  17. <tr>
  18.  
  19. $Day_Names
  20. </tr>
  21. <tr>
  22. $Cal_Weeks_Days
  23. <tr>
  24. </table>
  25. HTML;
  26. ?> (line no 103)
Sep 13 '07 #1
7 4734
ak1dnar
1,584 Expert 1GB
Hi bandula, check this out.

Expand|Select|Wrap|Line Numbers
  1. $php_data_goes_here='Some_php_out_put';
  2. echo 'HTML_DATA_GOES_HERE '.$php_data_goes_here.' AND_ANOTHER_HTML';
  3. echo '<br>';
  4. echo "YOUR HTML DATA AND $php_data_goes_here";
Please use the code tags when posting source codes in this format.
[code=php]
your php code goes here
[/code]
Sep 13 '07 #2
Your first line should be

Expand|Select|Wrap|Line Numbers
  1. echo <<<HTML
  2.  
Sep 13 '07 #3
For the love of god please don't use heredocs. If you insist on it please read the php doc on it.
http://www.php.net/manual/en/languag...syntax.heredoc
Sep 13 '07 #4
What's so wrong with heredoc? It has its uses. Biggest issue is modifying code later on and realizing that you're in heredoc.
Sep 13 '07 #5
ak1dnar
1,584 Expert 1GB
Any variables within heredoc will be parsed as PHP handles double quotation marks.but when you closing it do not use any spaces or other characters on it. in other words;

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. $some_var = 'String2';
  3. echo <<<EOT
  4. String1 $some_var String3
  5. /* because of this error comes*/EOT;
  6. ?>
  7.  
Sep 13 '07 #6
ak1dnar
1,584 Expert 1GB
Heya guys, I found something interesting with the forum text editor. I copied this to Wysiwyg editor:
<?php
$some_var = 'String2';
echo <<<EOT
String1 $some_var String3
EOT;
?>
And got this, after pressing CODE icon. See <EOT is missing
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. $some_var = 'String2';
  3. echo <<
  4. String1 $some_var String3
  5. EOT;
  6. ?>
So I think on the original post also, It has happened. (that was my fault, I am the one who add the CODE tags to the source codes)

So Its better to hand code the [code] tags with out clicking the icons on the editor. :D
Sep 13 '07 #7
What's so wrong with heredoc? It has its uses. Biggest issue is modifying code later on and realizing that you're in heredoc.
Output control is key if your using headers or sessions. If you use a heredoc you have to generate all that stuff at the end and probably not in the most efficient manor.
Sep 13 '07 #8

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

Similar topics

8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
36
by: rhys | last post by:
My Gurus and Angels -- Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
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...
9
by: ajd335 | last post by:
Hi all... I am getting an error Parse error: syntax error, unexpected $end in http:/..... on line 117...(117 is the EOF).. can you plz help me out..I have checked out for the < , > ,{ ,} etc.......
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
10
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
2
by: TanjaPetro | last post by:
Hello to everyone. I changed a few files on my site and when I tried to log into the admin area I got this message: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting...
3
by: CYNTHIA CUTRER | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> ...
5
by: vultren | last post by:
Parse error: syntax error, unexpected $end in I keep getting that, I have no clue where to fix it. Any help would be VERY APPRECIATED! <?php if(isset($_POST)) { // EDIT THE 2 LINES...
3
by: Ann Madden | last post by:
Hello - I am super green to php and mysql. I have received the following error: Parse error: syntax error, unexpected $end in C:\website\chart.php on line 84... I have been through the code matching...
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: 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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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...

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.