morpheus3g
asked on
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'>win dow.opener .document. getElement ById('lblI magesPrevi ew').inner HTML='{$ht ml}';windo w.close(); </script>
EOT;
?>
it give me the error: "Parse error: parse error, unexpected T_SL in /server/www/other/technews /technews. it/modules /news/admi n/index.ph p on line 1317"
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'>win
EOT;
?>
it give me the error: "Parse error: parse error, unexpected T_SL in /server/www/other/technews
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
it was a problem of whitespace.. Thank you all :)
This is how I use this type:
<?
$HELLO =<<<EOT
<HTML>
<HEAD><TITLE>TEST</TITLE><
<BODY>My name is Geir.</BODY>
</HTML>
EOT;
print $HELLO;
-Geir