Obtaining URL hash server-side
Moderator: General Moderators
Obtaining URL hash server-side
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
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
Already done that, it's not available there or in apache_request_headers()
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Obtaining URL hash server-side
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?).
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?).
(#10850)
Re: Obtaining URL hash server-side
I was fearing it would be something like this. Quite troublesome...