//This function gets the exact string that shows in the address bar. If you use it with no arguments, function will simply return the string, if you put TRUE as the argument, the function returns a html link to the current url. This works whether you are on a post or a page. It strips any other query information like searches.
function url_is($showlink = FALSE) {
if ($_GET['page_id'])
$query = 'page_id=' . $_GET['page_id'];
else
$query = 'p=' . $_GET['p'];
$urlis = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . '?' . $query;
if($showlink == TRUE)
return '<a href="' . $urlis . '">' . $urlis . '</a>';
else
return $urlis;
}