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 4593178
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:38:47+00:00 2026-05-21T22:38:47+00:00

Well lets try to explain am sorry about my english. I have some xml

  • 0

Well lets try to explain am sorry about my english.

I have some xml files where I get the url from with some php scripts

everything goes right the only prob is i want to change the li BGcolor of the selected link like in css :active or giving only that link eg a class=”current”

this below make dynamically the urls to the data

echo "<ul><li ><a  href='?xml1=".$xmlGet."&link=".$link." '>".$slide->title."</a></li></ul><br/>";

with the above i get a list of links not only one like below as urls

http://localhost/html5/playerEnd/hoofdstuks.php?xml1=chapter_3733&link=1
http://localhost/html5/playerEnd/hoofdstuks.php?xml1=chapter_3733&link=2
http://localhost/html5/playerEnd/hoofdstuks.php?xml1=chapter_3733&link=3
etc etc 

and it display as menu like this

link 1
link 2
link 3
link 4
etc etc

each link load a different data to my page when clicked so i want the one clicked to be active like an other color or something.

  • 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-21T22:38:48+00:00Added an answer on May 21, 2026 at 10:38 pm

    Use $_GET['link'] to find out which link has been clicked. Then add a class to the link which corresponds to this. You’ll have to define the active class.

    $linkID = $_GET['link'];
    
    echo "<ul><li ><a  href='?xml1=".$xmlGet."&link=".$link." '";
    
    if ($linkID == $link) { echo " class=\"active\" "; }
    
    echo ">".$slide->title."</a></li></ul><br/>";
    

    And if you want the li to have the class (as asked in comments):

    $linkID = $_GET['link'];
    
    echo "<ul><li";
    
    if ($linkID == $link) { echo " class=\"active\" "; }
    
    echo "><a  href='?xml1=".$xmlGet."&link=".$link."'>".$slide->title."</a></li></ul><br/>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for the unhelpful title, but hopefully I can explain this well enough. Lets
Well, I have a class Customer (no base class). I need to cast from
I'll try to explain the problem in the math language. Assume I have a
Well, I have a problem (ok, no real problem, but I wanna try out
I'm gonna try and simplify this as much as possible. Lets say i have
Sorry if my question is poorly worded. I'm struggling to express it well. Lets
Well I'm doing some Java - C integration, and throught C library werid type
Well i have a gridview where i have defined the columns on my own
Well i have a transparent div or the background is set to transparent :)
OK, this is impossible, but I will try to explain the situation here. Let's

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.