Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HEREDOC Help

Status
Not open for further replies.

Quijian

ISP
Jul 9, 2004
32
US
I've been trying to put html in php by using the heredoc syntax. I all I get is a parse error. I am running PHP 4.
This is th code:
Code:
echo <<<END 
<font size="3" face="Verdana, Arial, Helvetica, sans-serif"><a href="mail.php">Mail</a> 
.:. <a href="messages.php">Messages</a> .:. <a href="accounttools.php">Tools</a></font>
END;

Thanks for your help.
 
There is nothing wrong with the HEREDOC snippet up there.
I pasted and executed on PHP 4.3.10 without errors.
The parse error must be somwhere else.
 
hi,

on my site (PHP 4.3.10-2) the code above works withouth any problem.
Pls give us the entire page code.
Also the line number of the parse error is very useful.


May be `END' is a reserved word, try to use something like:
Code:
echo <<<ENDX
...
ENDX;


Regards,
Marcel

___
____
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top