MrXortex Posted August 2, 2013 Share Posted August 2, 2013 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 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">' . $userinfo['anvandarnamn'] . '</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. Quote Link to comment https://forums.phpfreaks.com/topic/280757-creating-dropdown-inside/ Share on other sites More sharing options...
MrXortex Posted August 2, 2013 Author Share Posted August 2, 2013 Anyone? come on? Quote Link to comment https://forums.phpfreaks.com/topic/280757-creating-dropdown-inside/#findComment-1443134 Share on other sites More sharing options...
lemmin Posted August 2, 2013 Share Posted August 2, 2013 Do any of the other links have drop downs? The drop down part would be controlled by Javascript, so you would have to integrate your PHP without that. Quote Link to comment https://forums.phpfreaks.com/topic/280757-creating-dropdown-inside/#findComment-1443201 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.