evo190
02-09-2009, 02:21 PM
This question has a bit of PHP included but it's mostly about the CSS style.
I have ONE page with a few links, but the links do not request a new file. It's like having only 'INDEX.html' for your entire site. Instead of going to INDEX_ABOUT.html, for 'About Us' information, I just do 'INDEX?cat=about' on the link - PHP handles the rest.
Anyway, with that in mind, I still want the links to change style for a better user experience.
Here's what I have so far:
STATIC
The first line of the page gets: <?php $thisPage="home"; ?>
LINKS
The "Home" link gets: <?php if ($thisPage=="home")
echo " id=\"currentpage\""; ?> which corresponds to a unique CSS style.
Therefore, if the "Home" link is pressed the style will be different than 'about us' or 'products'.
However, I need this to work for the other links...
HOME (a href=index?cat=home)
ABOUT US (a href=index?cat=about)
PRODUCTS (a href=index?cat=products)
So when I click "About Us" (a href=index?cat=about) there must be some way to dynamically change the STATIC line:
<?php $thisPage="home"; ?> to <?php $thisPage="about"; ?> or <?php $thisPage="producs"; ?>
I'm sure it's an echo or something. Help needed.
I have ONE page with a few links, but the links do not request a new file. It's like having only 'INDEX.html' for your entire site. Instead of going to INDEX_ABOUT.html, for 'About Us' information, I just do 'INDEX?cat=about' on the link - PHP handles the rest.
Anyway, with that in mind, I still want the links to change style for a better user experience.
Here's what I have so far:
STATIC
The first line of the page gets: <?php $thisPage="home"; ?>
LINKS
The "Home" link gets: <?php if ($thisPage=="home")
echo " id=\"currentpage\""; ?> which corresponds to a unique CSS style.
Therefore, if the "Home" link is pressed the style will be different than 'about us' or 'products'.
However, I need this to work for the other links...
HOME (a href=index?cat=home)
ABOUT US (a href=index?cat=about)
PRODUCTS (a href=index?cat=products)
So when I click "About Us" (a href=index?cat=about) there must be some way to dynamically change the STATIC line:
<?php $thisPage="home"; ?> to <?php $thisPage="about"; ?> or <?php $thisPage="producs"; ?>
I'm sure it's an echo or something. Help needed.