Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 17th Mar 2011, 01:48 PM   #1
Is a...
War Room Member
 
ECS Dave's Avatar
 
Join Date: 2007
Location: In the USA...
Posts: 269
Thanks: 65
Thanked 53 Times in 46 Posts
Blog Entries: 8
Lightbulb
Inside comment tags...
Share on: 
fb share twitter share gplus share more share

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

ECS Dave is offline  
Unread 17th Mar 2011, 02:54 PM   #2
HyperActive Warrior
 
Join Date: 2010
Posts: 160
Thanks: 11
Thanked 12 Times in 12 Posts
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

No, it doesnt.
Cash Money Hosting is offline  
Unread 17th Mar 2011, 09:11 PM   #3
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

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.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Unread 17th Mar 2011, 09:26 PM   #4
Active Warrior
 
Join Date: 2009
Posts: 54
Thanks: 1
Thanked 7 Times in 7 Posts
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

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.
IM Business is offline  
Unread 18th Mar 2011, 07:31 AM   #5
The Biggest Advert Online
 
RyanAndrews's Avatar
 
Join Date: 2011
Location: UK
Posts: 102
Thanks: 8
Thanked 12 Times in 12 Posts
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

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...
*/
?>

RyanAndrews is offline  
Unread 18th Mar 2011, 09:21 AM   #6
New Warrior Member
War Room Member
 
Jim Westergren's Avatar
 
Join Date: 2007
Location: Sweden
Posts: 17
Thanks: 4
Thanked 3 Times in 3 Posts
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

processed - yes
get seen - depends if there is any output such as echo, print etc.

Jim Westergren
JimWestergren.com | TodaysWeb
Jim Westergren is offline  
Unread 18th Mar 2011, 05:54 PM   #7
Is a...
War Room Member
 
ECS Dave's Avatar
 
Join Date: 2007
Location: In the USA...
Posts: 269
Thanks: 65
Thanked 53 Times in 46 Posts
Blog Entries: 8
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

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

ECS Dave is offline  
Unread 18th Mar 2011, 11:47 PM   #8
Wordpress Master
 
oknoorap's Avatar
 
Join Date: 2010
Location: Asia
Posts: 70
Thanks: 1
Thanked 4 Times in 4 Posts
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

no it doesn't , but please use

PHP Code:
<?php
// comment in one line
/*
multiple
line
*/
?>
in php.

thats called scalable programming rule.

Just Web Developer.
oknoorap is offline  
Unread 19th Mar 2011, 10:03 AM   #9
Is a...
War Room Member
 
ECS Dave's Avatar
 
Join Date: 2007
Location: In the USA...
Posts: 269
Thanks: 65
Thanked 53 Times in 46 Posts
Blog Entries: 8
Default
Re: Inside comment tags...
Share on: 
fb share twitter share gplus share more share

Originally Posted by SteveJohnson View Post

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.
Originally Posted by Jim Westergren View Post

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

ECS Dave is offline  
Closed Thread


Bookmarks

Tags
comment, inside, tags


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 06:15 AM.