Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Inside comment tags... (https://www.warriorforum.com/programming/350058-inside-comment-tags.html)

ECS Dave 17th March 2011 01:48 PM

Inside comment tags...
 
Quick question:

Does a php "snippet" get seen, thus processed, when inside of html comment tags?

Such as this:
Code:

<!--
some text, images, what-not
<? php snippet ?>
more text, etc...
-->

Thanks, and...

Be Well!
ECS Dave

Cash Money Hosting 17th March 2011 02:54 PM

Re: Inside comment tags...
 
No, it doesnt.

SteveJohnson 17th March 2011 09:11 PM

Re: Inside comment tags...
 
Yes, it most certainly does.

The output, if any, won't be shown in the browser window because it's within the HTML comment tags, but can be seen in the page source.

IM Business 17th March 2011 09:26 PM

Re: Inside comment tags...
 
If that php is parsed by the server, then there will be nothing there. If the php is not parsed, it will show up inside the comment but not visible in the browser.

RyanAndrews 18th March 2011 07:31 AM

Re: Inside comment tags...
 
It's almost best in all circumstances to use PHP comments. Why would you want to send this stuff to all users anyway.

<?php
/*
some text, images, what-not
php snippet
more text, etc...
*/
?>

Jim Westergren 18th March 2011 09:21 AM

Re: Inside comment tags...
 
processed - yes
get seen - depends if there is any output such as echo, print etc.

ECS Dave 18th March 2011 05:54 PM

Re: Inside comment tags...
 
Thanks everyone!

I had thought that "hiding" something in the html comment tags would not only hide what was between them, but not process it. I see I was mistaken, and have since fixed the issue that drove me to ask...

Be Well!
ECS Dave

oknoorap 18th March 2011 11:47 PM

Re: Inside comment tags...
 
no it doesn't , but please use

PHP Code:

<?php
// comment in one line
/*
multiple
line
*/
?>

in php.

thats called scalable programming rule.

ECS Dave 19th March 2011 10:03 AM

Re: Inside comment tags...
 
Quote:

Originally Posted by SteveJohnson (Post 3550556)
Yes, it most certainly does.

The output, if any, won't be shown in the browser window because it's within the HTML comment tags, but can be seen in the page source.

Quote:

Originally Posted by Jim Westergren (Post 3552911)
processed - yes
get seen - depends if there is any output such as echo, print etc.

Thanks guys...

The one line "snippet" was calling a function, that I didn't want called, so I simply
deleted it, instead of leaving it in the commented html code on the page.

Be Well!
ECS Dave


All times are GMT -6. The time now is 09:19 PM.