I tried so many combinations to get the correct path to my page, for example javascript code
escape(window.location.href)
I tried this:
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]$_SERVER[QUERY_STRING]";
but it returns something like:
http:
when the actual page:
http:
and if I have this URL: http://www.mydomain.com/node/4158#comments for example, the result:
http:
i.e. without "#comments"
source share