Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 24, 2012, 07:27 AM   #1
AFPoster
macrumors 65816
 
Join Date: Jul 2008
Location: Charlotte, NC
PHP Comments

So I'm attempting to add comments around certain lines of code in my Index.php file and for some reason they're still showing on my site. Any help would be greatly appreciated, code is below:

PHP Code:
/* This button to be hidden for now
<a class="btn btn-warning" href="#">Hello</a>
don't remove until proper approval */ 
I've also tried:

PHP Code:
#This button to be hidden for now <a class="btn btn-warning" href="#">Hello</a> 
Making sure this one is all on 1 line.
__________________
2012 15" MacBook Pro 2.3Ghz i7
iPad 2 32gb (white)
iPhone 5s 16gb x2
AFPoster is offline   0 Reply With Quote
Old Dec 24, 2012, 07:38 AM   #2
frocco
macrumors 6502
 
Join Date: Jan 2009
Make sure PHP is enabled on your site.
Code:
<?php
	phpinfo();
?>
__________________
Regards, Frank
frocco is offline   0 Reply With Quote
Old Dec 24, 2012, 07:47 AM   #3
Jessica Lares
macrumors 603
 
Jessica Lares's Avatar
 
Join Date: Oct 2009
Location: Near Dallas, Texas, USA
This might be of some help:
http://php.net/manual/en/language.ba...x.comments.php
__________________
Have You Hugged Your Mac Today?
Daily Expressions | iMac G4 | Late 2011 13" MacBook Pro | iPod Nano (7G) | iPad Mini | iPod Touch (5G) | iPhone 5S
Jessica Lares is online now   0 Reply With Quote
Old Dec 24, 2012, 08:14 AM   #4
AFPoster
Thread Starter
macrumors 65816
 
Join Date: Jul 2008
Location: Charlotte, NC
Thanks for the comments, already figured it out:

PHP Code:
<!--message here--> 
__________________
2012 15" MacBook Pro 2.3Ghz i7
iPad 2 32gb (white)
iPhone 5s 16gb x2
AFPoster is offline   0 Reply With Quote
Old Dec 24, 2012, 01:23 PM   #5
Laird Knox
macrumors 65816
 
Join Date: Jun 2010
Just a point of clarification.

The comments shown in your first post are PHP and the one in your last post is HTML.

I know you have already answered your own question. I'm just pointing this out because understanding the difference might save you some time in the future. They way PHP and HTML can be mixed on a page can make it difficult to follow what is going on.
Laird Knox is offline   0 Reply With Quote
Old Dec 25, 2012, 12:51 AM   #6
shootingrubber
macrumors 6502
 
Join Date: Mar 2009
Quote:
Originally Posted by AFPoster View Post
Thanks for the comments, already figured it out:

PHP Code:
<!--message here--> 
Those are HTML comments...
shootingrubber is offline   0 Reply With Quote
Old Dec 25, 2012, 01:42 AM   #7
Comeagain?
macrumors 68020
 
Comeagain?'s Avatar
 
Join Date: Feb 2011
Location: Spokane, WA
//comment in PHP (inside the <?php ?> tags)
#Comment in .htaccess
<!-- Comment in HTML -->
__________________
Questions? MRoogle it!
Current iOS 8 "All the little things!"
MR Scavenger Score: 1
Comeagain? is offline   1 Reply With Quote
Old Dec 25, 2012, 10:11 AM   #8
AFPoster
Thread Starter
macrumors 65816
 
Join Date: Jul 2008
Location: Charlotte, NC
Quote:
Originally Posted by Comeagain? View Post
//comment in PHP (inside the <?php ?> tags)
#Comment in .htaccess
<!-- Comment in HTML -->
Thanks for this! I have to adjust my .htaccess file so this is perfect.
__________________
2012 15" MacBook Pro 2.3Ghz i7
iPad 2 32gb (white)
iPhone 5s 16gb x2
AFPoster is offline   0 Reply With Quote
Old Dec 26, 2012, 03:43 PM   #9
SrWebDeveloper
macrumors 68000
 
SrWebDeveloper's Avatar
 
Join Date: Dec 2007
Location: Alexandria, VA, USA
 
Quote:
Originally Posted by AFPoster View Post
Thanks for this! I have to adjust my .htaccess file so this is perfect.
One clarification, while inside PHP tags <?php and ?> there are two approaches:

PHP Code:
// to comment current single line only like this one. 
PHP Code:
/* 
To add a multiline comment as
big as you need.
*/ 
__________________
Jim Goldbloom
Sr. Web Developer, owner GoldTechPro, LLC
http://www.GoldTechPro.com
SrWebDeveloper is offline   0 Reply With Quote

Reply
MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
[php] - php problems os x mountain lion 10.8.2 cakas6933 OS X 10.8 Mountain Lion 4 Jun 10, 2014 08:08 AM
Anyone went from a 5 to a 5C - comments pls MrMister111 iPhone 19 Dec 10, 2013 05:21 PM
Spotlight comments? shawnperson OS X 10.8 Mountain Lion 4 Apr 30, 2013 07:22 PM
Comments and Criticism please! adamvk Design and Graphics 37 Jul 26, 2012 01:56 AM

Forum Jump

All times are GMT -5. The time now is 07:06 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC