Hi Angus,

The comment you use depends on the context. If you are in a PHP interpreted
section, use /* ... */ (for a block comment), // or # (for commenting out
the rest of a line).

The syntax you are using works in (X)HTML and as John points out your syntax
is incorrect. You also cannot have two dashes contained in the (X)HTML
comment block.

A correct example using both comment styles would be:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
<head>
        <title>My title</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
/>
        <link type="text/css" rel="stylesheet" rev="stylesheet" href="
/css/styles.css" />
        <!--[if lt IE 7]>
        <link type="text/css" rel="stylesheet" rev="stylesheet" href="
/css/styles_ie6.css" />
        <![endif]-->
</head>

<body>

<div>

<!--
        This text is sent to the browser but is ignored.
-->

Your IP is: <?php echo $_SERVER['REMOTE_ADDR']; // comment to end of line ?>

<?php
/*
        This entire block is interpreted by the server and is stripped out.
It never gets sent to the browser
*/
?>

</div>
</body>
</html>



Hope that helps,
Kepler


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Hayden's Harness Attachment
Sent: Monday, December 10, 2007 12:41 AM
To: WSG List
Subject: [WSG] Comment mark

I would like to appologize if I am off topic. I am not sure who to ask. I am
using <!-- ... --!> to comment out a line in a PHP file. Firefox2.x will use
it to comment out a link and IE7 will not use. Am I doing the commenting a
line out right?
Angus



*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************



*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to