Hi,
I have some PHP code in a project which if a user is logged in the in will display the username and other options and if the user is a guest it wont.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Home</title>
</head>
<body>
<!-- HTML Layout here -->
<?php
if($session->logged_in){
echo "Welcome $user"
."<a href="index.php">Home</a><br>"
."<a href="forums.php">Forums</a><br>"
."<a href="downloads.php">Downloads</a><br>"
."<a href="profile.php">Profile</a><br>"
."<a href="settings.php">Settings</a><br>";
}
else {
echo "Welcome Guest"
."<a href="index.php">Home</a><br>"
."<a href="forums.php">Forums</a><br>"
."<a href="downloads.php">Downloads</a><br>";
}
?>
</body>
</html>
now even though this works my project needs to be validated but the validator fails because of the php coding it says the following
# Error Line 1208, Column 83: character data is not allowed here
…strong>$session->username</strong> <span style='font-size: 80%;'></span></li>'
You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include:
* putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
* forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
* using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
is there a way i can bypass this part of the coding or can i change something in the code which the validator will accept.