Page 1 of 1
Obtaining URL hash server-side
Posted: Wed Dec 03, 2008 3:00 pm
by Eran
I need to retrieve the complete URL as it appears in the browser, including information after the hash sign (#). Unfortunately, $_SERVER['REQUEST_URI'] contains the URL without the hash. Does anybody has an idea on how to fetch it server-side? is this even possible?
Re: Obtaining URL hash server-side
Posted: Wed Dec 03, 2008 3:04 pm
by requinix
Not sure if you can get that. Print out the $_SERVER array and see if anything works for you.
Re: Obtaining URL hash server-side
Posted: Wed Dec 03, 2008 3:07 pm
by Eran
Already done that, it's not available there or in apache_request_headers()
Re: Obtaining URL hash server-side
Posted: Wed Dec 03, 2008 3:26 pm
by Christopher
I don't think you can get it that way. The "#" is the fragment identifier. It is part of the URI, but not part of the URL. I don't think the browser even passes it.
You probably need to do some Javascript thing by having the browser identify the fragment and add it somehow to the URL or communicated it some other way (Ajax?).
Re: Obtaining URL hash server-side
Posted: Wed Dec 03, 2008 3:36 pm
by Eran
I was fearing it would be something like this. Quite troublesome...