0

Hello.

I have a little complex code for a navigation menu. I want to add a dropdown to a <li> tag but it doesn't work.

Heres the code

<div id="topbar" class="fadeInOnLoad">
<div class="inner-topbar">
    <ul>
        <?php
        if(currentPageName() == 'index.php'){
            echo '<li class="">Home</li>';
        }else {
            echo '<li><a href="index.php">Home</a></li>';
        }

        if(currentPageName() == '../about.php'){
            echo '<li class="">About</li>';
        }else {
            echo '<li><a href="../about.php">About</a></li>';
        }

        if(currentPageName() == 'terms.php'){
            echo '<li class="">Terms</li>';
        }else {
            echo '<li><a href="terms.php">Terms</a></li>';
        }

        if(currentPageName() == 'contact.php'){
            echo '<li class="">Contact</li>';
        }else {
            echo '<li><a href="contact.php">Contact</a></li>';
        }

        if(currentPageName() == 'browse.php'){
            echo '<li class="">Browse Files</li>';
        }else
            echo '<li><a href="browse.php">Browse Files</a></li>';


        if($inLoggad == true){

            //if user is logged in

            if(currentPageName() == 'upload.php'){
                echo '<li class="">Upload Files</li>';
            }else {
                echo '<li class="uploader"><a href="upload.php">Upload Files</a></li>';
            }


        //right side of the nav-bar

            //if user is logged in


            echo '<li class="highlight floatRight highlight"><a href="login.php?action=logout&ref=index.php">Logout</a></li>';


            if(currentPageName() == 'account.php'){
                echo '<li class="current floatRight highlight">My Account</li>';
            }else {
                echo '<li class="floatRight highlight"><a href="account.php">' . $userinfo['anvandarnamn'] .'</a></li>';
            }           
        }else {

            //if user is not logged in

            if(currentPageName() == 'register.php'){
                echo '<li class="current floatRight highlight">Register</li>';
            }else {
                echo '<li class="floatRight highlight"><a href="register.php?&ref=index.php">Register</a></li>';
            }


            if(currentPageName() == 'login.php'){
                echo '<li class="current floatRight highlight">Login</li>';
            }else {
                echo '<li class="loginToggle floatRight highlight"><a href="#">Login</a></li>';
            }

        }

        ?>
    </ul>

</div> <!-- inner-topbar -->
</div> <!-- topbar -->

So I want the account.php (My Account) to have the drop down. Inside it should have Logout.php and upload.php. But I don't know where to put it. I never experimented with these types of codes. They always mess up.

Thanks.

3
Contributors
3
Replies
33
Views
4 Years
Discussion Span
Last Post by Zagga
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.