forcer Posted July 1, 2008 Share Posted July 1, 2008 I have a website design that has a tab effect on top. e.g.. if i am on the home page the tab HOME is highlighted and the rest are backdropped... but if i go to contact page, CONTACT gets highlighted and the rest are backdropped... the code i am currently using to display image links from my CMS is... echo '<a href="'.$categorylink[$i].'"><img src="skins/audioloop/images/cat/' . $categoryname[$i] . '.gif" /></a>'; i'm guessing i need something along these lines.. if $categoryname[$i] == $categoryname[$i] { echo ''<a href="'.$categorylink[$i].'"><img src="skins/audioloop/images/cat/' . $categoryname[$i] . '_focused.gif" /></a>'; } else { echo '<a href="'.$categorylink[$i].'"><img src="skins/audioloop/images/cat/' . $categoryname[$i] . '.gif" /></a>'; } i'm quite new to PHP... any ideas? Thanks Link to comment https://forums.phpfreaks.com/topic/112771-highlight-link-if-on-that-page/ Share on other sites More sharing options...
dmccabe Posted July 1, 2008 Share Posted July 1, 2008 I think it would be better done with CSS. http://www.echoecho.com/csslinks.htm A:active Defines the style for active links. A link becomes active once you click on it. Link to comment https://forums.phpfreaks.com/topic/112771-highlight-link-if-on-that-page/#findComment-579199 Share on other sites More sharing options...
forcer Posted July 1, 2008 Author Share Posted July 1, 2008 css cant decide what page we're actually on... i would need some sort of script to identify what page i am on. Link to comment https://forums.phpfreaks.com/topic/112771-highlight-link-if-on-that-page/#findComment-579614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.