Jump to content

Recommended Posts

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.


Link to comment
https://forums.phpfreaks.com/topic/280757-creating-dropdown-inside/
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.