Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5842811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:04:02+00:00 2026-05-22T12:04:02+00:00

im sorry for the poor title, i dont know how to explain it. You

  • 0

im sorry for the poor title, i dont know how to explain it. You see i have already created my panel tabs with the help of ol, li and css. it is working perfectly but then there is one problem that occured in the program. this tab li class=”current”

the purpose of the class=current that is set in a specified link will help change the background image of the active link. the css code for that is already set and working. I will first show you the codes i used here:

<ol id="toc">
                <li>&nbsp;&nbsp;&nbsp;</li>
                <li class="current"><a href="index.php"><span>#</span></a></li>
                <li><a href="index.php?namelist=a"><span>A</span></a></li>          
                <li><a href="index.php?namelist=b"><span>B</span></a></li>              
                <li><a href="index.php?namelist=c"><span>C</span></a></li>      
                <li><a href="index.php?namelist=d"><span>D</span></a></li>          
                <li><a href="index.php?namelist=e"><span>E</span></a></li>          
                <li><a href="index.php?namelist=f"><span>F</span></a></li>          
                <li><a href="index.php?namelist=g"><span>G</span></a></li>
                <li><a href="index.php?namelist=h"><span>H</span></a></li>          
                <li><a href="index.php?namelist=i"><span>I</span></a></li>              
                <li><a href="index.php?namelist=j"><span>J</span></a></li>              
                <li><a href="index.php?namelist=k"><span>K</span></a></li>      
                <li><a href="index.php?namelist=l"><span>L</span></a></li>      
                <li><a href="index.php?namelist=m"><span>M</span></a></li>                  
                <li><a href="index.php?namelist=n"><span>N</span></a></li>      
                <li><a href="index.php?namelist=o"><span>O</span></a></li>          
                <li><a href="index.php?namelist=p"><span>P</span></a></li>          
                <li><a href="index.php?namelist=q"><span>Q</span></a></li>          
                <li><a href="index.php?namelist=r"><span>R</span></a></li>              
                <li><a href="index.php?namelist=s"><span>S</span></a></li>                  
                <li><a href="index.php?namelist=t"><span>T</span></a></li>          
                <li><a href="index.php?namelist=u"><span>U</span></a></li>              
                <li><a href="index.php?namelist=v"><span>V</span></a></li>  
                <li><a href="index.php?namelist=w"><span>W</span></a></li>          
                <li><a href="index.php?namelist=x"><span>X</span></a></li>          
                <li><a href="index.php?namelist=y"><span>Y</span></a></li>              
                <li><a href="index.php?namelist=z"><span>Z</span></a></li>
                </ol>   

as you can see here is the list of links that i have. its purpose is to search the employee name and information from the database and output in on the next tags where the name of the employee must start with the letter specified in the link list A-Z that were clicked.

now my problem is, the links are called to the same page and does not contain its own php file. from the site that was recommended on me to study, i saw that each linked have its own php file thus the only difference is the location on the class=current example:

if your on A.php

    <ol id="toc">
<li class="current"><a href="A.php"><span>A</span></a></li>         
<li><a href="B.php"><span>B</span></a></li>
</ol>

the link in that page contains the class=current but the other li tags does not, else when clicked on a different link like for example on B.php

<ol id="toc">
<li><a href="A.php"><span>A</span></a></li>         
<li class="current"><a href="B.php"><span>B</span></a></li>
</ol>

the class=”current” is in link B.

but mine is called in the same page by inserting ?namelist=a in each link. if i put class=”current” on every li link, i would be able to get what i want which is making it able to see your current page. does anyone here knows how?? thanks for those who will reply 🙂

MisaChan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:04:03+00:00Added an answer on May 22, 2026 at 12:04 pm

    This function will loop through a to z and check if the current page is index.php?namelist=a or b,c ect determining where to place the class=”current”

    function toc_menu($current){
        $return ='<ol id="toc">
                    <li>&nbsp;&nbsp;&nbsp;</li>'."\n";
        $return .= ($current=='') ? '<li class="current"><a href="index.php"><span>#</span></a></li>'."\n" : '<li><a href="index.php"><span>#</span></a></li>'."\n";
        foreach(range('a','z') as $link){
            $return .= ($current==$link) ? '<li class="current"><a href="index.php?namelist='.$link.'"><span>'.strtoupper($link).'</span></a></li>'."\n" : '<li><a href="index.php?namelist='.$link.'"><span>'.strtoupper($link).'</span></a></li>'."\n";
        }
        $return .="</ol>\n";
        return $return;
    }
    
    //echo where you want the menu
    echo toc_menu(strtolower($_REQUEST['namelist']));
    
    //or hold it in a variable to display later on
    $tocmenu = toc_menu(strtolower($_REQUEST['namelist']));
    

    //outputs this is E was clicked

       <ol id="toc">
                    <li>&nbsp;&nbsp;&nbsp;</li>
    <li><a href="index.php"><span>#</span></a></li>
    <li><a href="index.php?namelist=a"><span>A</span></a></li>
    <li><a href="index.php?namelist=b"><span>B</span></a></li>
    <li><a href="index.php?namelist=c"><span>C</span></a></li>
    <li><a href="index.php?namelist=d"><span>D</span></a></li>
    <li class="current"><a href="index.php?namelist=e"><span>E</span></a></li>
    <li><a href="index.php?namelist=f"><span>F</span></a></li>
    
    <li><a href="index.php?namelist=g"><span>G</span></a></li>
    <li><a href="index.php?namelist=h"><span>H</span></a></li>
    <li><a href="index.php?namelist=i"><span>I</span></a></li>
    <li><a href="index.php?namelist=j"><span>J</span></a></li>
    <li><a href="index.php?namelist=k"><span>K</span></a></li>
    <li><a href="index.php?namelist=l"><span>L</span></a></li>
    <li><a href="index.php?namelist=m"><span>M</span></a></li>
    <li><a href="index.php?namelist=n"><span>N</span></a></li>
    <li><a href="index.php?namelist=o"><span>O</span></a></li>
    
    <li><a href="index.php?namelist=p"><span>P</span></a></li>
    <li><a href="index.php?namelist=q"><span>Q</span></a></li>
    <li><a href="index.php?namelist=r"><span>R</span></a></li>
    <li><a href="index.php?namelist=s"><span>S</span></a></li>
    <li><a href="index.php?namelist=t"><span>T</span></a></li>
    <li><a href="index.php?namelist=u"><span>U</span></a></li>
    <li><a href="index.php?namelist=v"><span>V</span></a></li>
    <li><a href="index.php?namelist=w"><span>W</span></a></li>
    <li><a href="index.php?namelist=x"><span>X</span></a></li>
    
    <li><a href="index.php?namelist=y"><span>Y</span></a></li>
    <li><a href="index.php?namelist=z"><span>Z</span></a></li>
    </ol>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for the poor title,I'm new to OOP so I don't know what is
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry for the poor title, I don't really know what to call this. I
Sorry for the poor title guys, but I'm whooped. I have a table as
Hello (sorry for the poor title) I have a user control which loads different
sorry for the poor choice of words, I dont know exactly how the Android
I apologize for the poor title, I don't know how else to explain it.
Sorry for the poor title. I really have no idea how to describe this
I'm sorry about the title. I know it is rather poor but I wasn't
Sorry for the poor title, can't think of a succinct way of putting this..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.