thindery1 Posted March 5, 2009 Share Posted March 5, 2009 I need to design a function so that when a user is viewing my forum instead of other pages, it hi lights the tab specified forum in my header navigation. If the url link is http://domain.com/forum/ and my posts are viewed like: http://domain.com/forum/topic?id=x is it possible to have php figure out that when the url has http://domain.com/forum/ in it, to display the certain function? You can see how I am using it below. <? //part of header tab links if (*url contains http://domain.com/forum/*) { $addclass = ' class="current_page"'; } else { $addclass = ''; } echo "<li" . $addclass . "><a href='" . get_option('forum') . "/' title='Forum'><span>Forum</span></a></li>"; ?> Link to comment https://forums.phpfreaks.com/topic/148121-can-php-recognize-the-url-structure/ Share on other sites More sharing options...
Mark Baker Posted March 5, 2009 Share Posted March 5, 2009 take a look at the parse_url() function Link to comment https://forums.phpfreaks.com/topic/148121-can-php-recognize-the-url-structure/#findComment-777525 Share on other sites More sharing options...
cooldude832 Posted March 5, 2009 Share Posted March 5, 2009 .htaccess will help you do this Link to comment https://forums.phpfreaks.com/topic/148121-can-php-recognize-the-url-structure/#findComment-777527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.