W3C home > Mailing lists > Public > www-validator@w3.org > May 2009

RE: Php echo li-tag not seen by validator - SOLVED

From: Nick Woolley <nick@estores.org.uk>
Date: Thu, 28 May 2009 17:54:46 +0100
To: <www-validator@w3.org>
Message-ID: <00b601c9dfb5$02bdd640$0d00000a@inspired.brooksbank.org.uk>
DES: in response to your comment I've re-checked my code and I confirm
that the php/sql code below is causing the validator to not see the
content within a php while loop (I see the content is missing in the
validator's source - thank you for the pointer) even though the content
is displayed on the webpage without any errors; the missing content
includes the <li> tags, hence the validator is returning an error
because the <ul> tags appear not to include any <li> tags between.

$query = "select cd.categories_name from pages_categories_description cd
where cd.language_id='" . (int)$languages_id ."'";
$result = mysql_query($query);
while ($row = tep_db_fetch_array($result))  {
  echo '<li>'.htmlspecialchars($row['categories_name']).'</li>';
}

The above php code causes an xhtml fail unless I explicitly set the
value of $languages_id to 1; even though it's value has been set
elsewhere in the code, and echo (int)$languages_id outputs 1 to the
webpage. 

Thanks,
Nick
Received on Thursday, 28 May 2009 16:52:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:35 GMT