I have a .php page that I am trying to validate,
using w3.org Nu Html Checker.
When I view page source and copy & paste in validator I get the following:
Error: No p element in scope but a p end tag seen.
From line 102, column 13; to line 102, column 16
</table> </p> ↩
It occurs in both Chrome & FireFox.
Is it possibly because of the else {' '} clause on the end of the php code block?
This is right where the php would stop rendering the tables on the page.
I have tried commenting out the else clause, saving the file and refreshing the browser and the tag still appears.
If I try to validate by copy & paste from notepad++ I get the following:
Error: Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.)
This is the php code block:
include "conn_to_mysqli.php";
//this block grabs the list for viewing
$dynamiclist = '';
$sql = mysqli_query($con, 'SELECT * FROM `products` ORDER BY `date_added` ASC LIMIT 6');
$product_count = mysqli_num_rows($sql);
if ($product_count > 0) {
while ($row = mysqli_fetch_array($sql)) {
$id = $row['id'];
$product_name = $row['product_name'];
$price = $row ['price'];
$details = $row ['details'];
$dynamiclist .=
'<table >
<tr>
<td style="width:20%" ><img width="96" height="96" src="store_admin/inventory_images/'.$id.'.jpg" alt="image"/></td>
<td style="width:80%" >'.$product_name.'<br>
$'.$price.'<br>
<a href=" product.php?id='.$id.'"> View Product Details</a>
</td>
</tr>
</table>';
}
} else {
$dynamiclist = 'We have no products listed in your store yet';
}
The mystery </p> tag occurs right after the </table> tag.
<td style="width:20%" ><img width="96" height="96" src="store_admin/inventory_images/6.jpg" alt="image"/></td>
<td style="width:80%" >cruzer lite pink<br>
$299.99<br>
<a href=" product.php?id=6"> View Product Details</a>
</td>
</tr>
</table></p>
Please notify me if the complete html code is needed for your review.
[ATTACH]5453[/ATTACH]
p tag.png