A hash (string, including #) is never passed to the server; this is an exclusively behavioral property of the browser. However, the variable $_SERVER['REQUEST_URI'] will contain the rest.
If you really need to know what a hash is, you will need to use the JavaScript document.location.hash property, which contains the contents of the hash (you could then paste it into the form or send it to the server form with an ajax request). You can pass the full URL, including the anchor (the part after #), using the Javascript onload function , which sends the URL to the ajax endpoint.
You can also look here Get the entire URL, including the query string and binding
Suvash sarker
source share