carface Posted May 23, 2011 Share Posted May 23, 2011 I have a navigation menu but when viewd in IE the page displays incorrectly. I think this is because the start and end tags arent lining up correctly or its an attributes construct error or both. Here is the code: <div id="topNav"> <ul> <li><a href="index.php" <?php if($page == "index.php") echo 'class="current"'; ?>>Home</a></li> <li><a href="members.php" <?php if($page == "members.php") echo 'class="current"'; ?>>Members</a></li> <?php if($authenticated) {if (!isset($_SESSION['sysadmin'])){echo '<li><a href="memberProfile.php?id='.$userid.'"';}else{echo '<li><a href="admin.php"';} if($page == "memberProfile.php") echo 'class="current"'; echo'>'."$name".'</a></li>';} ?> <?php if(!$authenticated) {echo '<li><a href="register.php"';if($page == "register.php") echo 'class="current"'; echo'>Register</a></li>';} ?> <?php if($authenticated) {echo '<li><a href="session_destroy.php">Logout</a></li>';} else {echo '<li><a href="login.php">Login</a></li>';} ?> </ul> </div> When I run the page through W3C validation it gives these errors: Line 24, Column 38: attributes construct error <li><a href="register.php"class="current">Register</a></li> Line 24, Column 38: Couldn't find end of Start Tag a line 24 <li><a href="register.php"class="current">Register</a></li> Line 24, Column 66: Opening and ending tag mismatch: li line 24 and a …gister.php"class="current">Register</a></li> <li><a href="login.php… Line 24, Column 71: Opening and ending tag mismatch: ul line 20 and li …r.php"class="current">Register</a></li> <li><a href="login.php">Log… Line 24, Column 80: Opening and ending tag mismatch: div line 19 and ul …ss="current">Register</a></li> <li><a href="login.php">Login</a></l… I think all the other errors are occurring because of the first error so if anyone can help me out it will be much appreicated! Link to comment https://forums.phpfreaks.com/topic/237172-where-do-i-put-the-end-tag/ Share on other sites More sharing options...
fugix Posted May 23, 2011 Share Posted May 23, 2011 it might be something as simple as in your li tags <li><a href="register.php"class="current">Register</a></li> you need a space between the href closing quotation and you class...e.g <li><a href="register.php" class="current">Register</a></li> Link to comment https://forums.phpfreaks.com/topic/237172-where-do-i-put-the-end-tag/#findComment-1218920 Share on other sites More sharing options...
carface Posted May 23, 2011 Author Share Posted May 23, 2011 Great that's worked thankyou very much! Link to comment https://forums.phpfreaks.com/topic/237172-where-do-i-put-the-end-tag/#findComment-1219078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.