PHP HERE DOCUMENT PROBLEM

Hi experts

i'm experiencing a problem using the here document method in php.

i wrote the following
<?php
php codes....

print <<<EOT
<script type='text/javascript'>window.opener.document.getElementById('lblImagesPreview').innerHTML='{$html}';window.close();</script>
EOT;

?>

it give me the error: "Parse error: parse error, unexpected T_SL in /server/www/other/technews/technews.it/modules/news/admin/index.php on line 1317"


LVL 2
morpheus3gAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Diablo84Commented:
hi morpheus3g,

I believe T_SL refers to the shift left bitwise operator (which is <<).

Usually this is a result of whitespace.

Do you have a space...

print <<<EOT <--here?

Check that there is no white space around the first or the last line in the heredoc syntax.

Diablo84

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
geir_andersenSystems engineerCommented:
I think your syntax is a bit wrong.

This is how I use this type:
<?
$HELLO =<<<EOT
<HTML>
<HEAD><TITLE>TEST</TITLE></HEAD>
<BODY>My name is Geir.</BODY>
</HTML>
EOT;

print $HELLO;

-Geir
geir_andersenSystems engineerCommented:
Again...
Also your syntax is right. Check Diablo84 suggestion.
I got the same error and thought the syntax was wrong, but I also had a space at the end.
(Fingers working to fast.)

-Geir
morpheus3gAuthor Commented:
it was a problem of whitespace.. Thank you all :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.