/ Published in: PHP
Returns the full URL of the current page - including any query parameters.
Expand |
Embed | Plain Text
function full_url() { $protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']; }
Comments
Subscribe to comments
You need to login to post a comment.

hii thanks for the above info, but its not satisfying my requirement
what i need to trace is not ust url with query strin but i also need to trace #href
i.e. if my url is http://jigishthakar.com/?p=2#cid
then till http://jigishthakar.com/?p=2 ur code works fine but now how to trace #cid ?
i need also to get whats after the "#" so if the "#" is encoded u can get it whit $GET, $POST, $_REQUEST etc. :)
i think, php can not get the values after # cause its not passed to the server.