On Wed, Mar 11, 2009 at 7:51 PM, Patrick Moloney <webpa...@gmail.com> wrote:
> OK, I think I've got the problem. I had to go back further than where the
> problem appeared to be. The 1st error was the comment code on the div line
> before the menu is Included. It had the "--" in the comment.
> Oddly, it interacts with the same error in the comment in the mainmenu file.
> I saw some suggestion that these work in pairs but fail in odd numbers. So,
> I have many pages that work like this.
> Adding another bad comment to the mainmenu, causes it to fail (3 bad lines).
> Or, without a third line, fixing the only bad line in the mainmenu also
> fails! Now, correcting the bad line in the web page fixes that -- (whoops) -
> but causes all the other similar web site pages to start failing.
> I'll have to fix them all, but at least I know the problem.
> No wonder nobody comments code!
> mainmenu.php
> <!-- Comment on the First Line -->
> <!-- Comment on the -- Second Line -->
> Functional Menu code
> ...
> webpage.php
> ...
> <Body>
> <div id="menu"> <!-- Include the -- menu here -->
> <?php include 'mainmenu.php';  ?>
> </div>
> ...

I do use PHP comments (probably not as much as I should), but I don't
usually use HTML comments. This is partly (largely?) because HTML
comments get passed on to the client which wastes (albeit usually a
small amount of) extra space and bandwidth for each request, and they
give out implementation details to people who least need to know them.

I can sort of see adding the HTML comments when designing a full page
template so it is easier to determine where dynamic content needs to
be inserted when you start slicing the template apart, but even then I
usually remove those comments later in the design process before I put
the code out for production. Then again, I haven't included files for
anything other than function/class libraries in years either.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to