I got a problem. I use curPageUrl() function to locate the link to my file and use it as 'active' to get some CSS effects.
This is the curPageUrl() code:
function curPageURL() {
$pageURL = 'http';
if ($_SERVER['HTTPS'] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER['SERVER_PORT'] != "80") {
$pageURL .= $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
} else {
$pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
}
return $pageURL;
}
And this is my html code:
<a href='home.php'><li class="<?php if (curPageUrl() == 'http://something/home.php') {echo 'active';} ?>">Home</li></a>
But the problem begins when I start using $_GET[] method so the next link http://something/home.php?some_get_code is no more 'active'.
How can I concatenate everything after home.php so my link still be active?