Forum Moderators: coopster

Message Too Old, No Replies

"comments" in .inc.php

help

         

Acternaweb

4:33 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



I am trying to make notes/comments in a inc.php file and am not having luck. Bascially I want to document what code points too. Thanks for the help

NickCoons

4:36 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



Can you post examples of what you're trying to do that's not working? Comments in an include file should work just like comments in its parent .php file, just prepend each line of comments with a hash.. #

ukgimp

4:42 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



double "/"

<?
// This should comment out

$code = "Hello";
echo $code;

// wow that was easy :0

?>

dreamcatcher

4:50 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



or

/*I`m a comment. Woo Hoo!*/

:)

Acternaweb

5:05 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



I tried the above and it didn't work

Here is the sample code, the word "slideshow" still shows up:

<td align=\"left\" width=\"20%\"><table style=\"padding:1px;border-width:1px;

border-color:$VAR_menufontcolor;border-style:solid;font-family:$VAR_menufont;font-size:$VAR_menufontsize;color:$

VAR_menufontcolor;\"><tr><td nowrap><span id=\"".$uniqnum."_sds\"> $diapo_string </span></td></tr></table>
</td>
<td>&nbsp;</td>

//slideshow!//

<td align=\"center\">
<img alt=\"\" id=\"pref\" onMouseOver=\"if(document.all) { this.style.cursor='hand' ; } else {

this.style.cursor='pointer' ; } if(".$uniqnum."_vpdd == 0) {

".$uniqnum."_fml('".$lang[$VAR_langgalleryhp]["configslide"]."') ;} else

Timotheos

5:26 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've enjoyed the commentary so far... hehe ;-)

That's an interesting bit of sample code you have there and I'm just wondering if it's being parsed correctly in php. It it's actually part of html then you'll need to comment it with <!-- comment --> but if it truly is in php then the above examples should work. I'd be interested to see what the source looks like on the generated page.

Tim

shady

5:33 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



Well, it isn't php!

mcfly

5:46 pm on Dec 6, 2003 (gmt 0)

10+ Year Member



Even though your include statement is surrounded by <?php?> tags, the included file won't necessarily be recognised as php unless you specifically use the tags again.

eg. In test.php
<?php
include myinclude.inc.php;
?>

In myinclude.inc.php
<?php //you must use the php tags again
//another comment
?>

dreamcatcher

7:16 pm on Dec 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe try:

<!--//slideshow!//-->

(this will be visible in the browser though in your source code)

Oh and sorry, just saw your post Tim.