Jump to content

Where do I put the end </a> tag??


carface

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.