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! Quote Link to comment 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> Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.