assign a class of current to the current page in the navigation when all headers are included via <?php include()?> -


I have all the header and top navigation that includes a page with PHP

I want to assign I & lt; Li class = "on" & gt; There is a square for

, so I have & lt; Li & gt; and there is a current list, the page should be a square of "current"

and the body should be a square of the current page

for = body & lt; Body class "home" & Gt; and similarly

thanks

you can use something Like:

   

You can compare $ _SERVER ["REQUEST_URI"] with links to each navigation item. Note that $ _SERVER ["REQUEST_URI"] can be deceived by the customer , so make sure you make anything awkward before using it or displaying it back on the page.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -