Re: Comment modes behavior in HTML and PHP

From: Date: Sat, 28 Jul 2007 14:07:33 +0000
Subject: Re: Comment modes behavior in HTML and PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-259741@lists.php.net to get a copy of this message
On Sa, Jul 28, 2007 at 03:40:07 +0100, C.R.Vegelin wrote: > I have a PHP script, as follows: > <!-- > <?php > echo "should this be echoed ?"; > ?> > --> > > As expected, the browser shows nothing, > but when I view Source in the browser, I see: > <!-- start HTML comment > should this be echoed ?--> > > Shouldn't it be just: <!-- -->, without the echo result ? > I don't expect PHP to be active between <!-- -->. No, you're expecting something wrong. A <!-- ... is a HTML Comment which has nothing to do with the PHP Script execution on server side. Server sided php code execution is only bound to <? indicators. > > TIA, Cor So far. Rob -- Robert Patrick Degen pgp-publickey http://www-users.rwth-aachen.de/robert.degen/publickey.asc e-mail Robert.Degen@RWTH-Aachen.DE cellular 0049 - 176 - 22 08 95 01 private 0049 - 241 - 966 18 72

« previous php.general (#259741) next »