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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.