Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Active navigation pages
Old 06-27-2009, 08:01 PM Active navigation pages
Average Talker

Posts: 28
Trades: 0
Hi,

Currently what I am trying to do, is on my website, if someone is on a certain page, the button for that changes to a different colour (e.g. if someone clicks on "About Us", then when they go into the page, the rest of the buttons stay one colour and the About Us is a different colour. I currently have the following pages on my site:

The CSS, a page called "pages.php" (which has all the navigation buttons on) and the actual site contents (contactus.php, aboutus.php, gallery.php) etc. All the pages with the site contents have the include function, to include pages.php. Before I had the pages.php file, I used a command like

<a href="#" class=" active"><span><span>Home</span></span></a>

This meant that when the homepage.php was clicked on, the button would change colour (when the user enters the page). Since creating the extra pages.php page, I am unable to do this. I have been given some guidance to add something like the following to the pages.php:

<ul class="artmenu">

<?
$x = "";
if ($_SERVER['SCRIPT_NAME'] == "categories.php") {
$x = "active";
}
?>
<li><a href="categories.php" class=" <? echo $x; ?>"><span><span>Gallery</span></span></a></li>
</ul>

But I am unable to get this to work. The main reason for this is because I think there is no link from the pages.php file to the CSS. Can someone assist please?

Thanks,
oodya is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-28-2009, 08:17 AM Re: Active navigation pages
akratellio's Avatar
Experienced Talker

Posts: 30
Location: Berlin Germany Europe World
Trades: 0
just insert
Code:
<link rel="stylesheet" type="text/css" media="screen" href="pathOfCSSFile" />
in each side which includes pages.php

mfg akratellio
__________________
I'm always lying...
Ich lüge immer...

Please login or register to view this content. Registration is FREE
akratellio is offline
Reply With Quote
View Public Profile Visit akratellio's homepage!
 
Reply     « Reply to Active navigation pages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.01946 seconds with 12 queries