I am asked to work with a service that changes my websites url to: http:://example.com/#/?id=9
I cannot seem to be able to get the id from such URL. $_GET is empty, $_SERVER['REQUEST_URI'] only contains /.
How am I supposed to get to the params?
Things I have tried:
Zend_Debug::dump($_GET); // outputs array(0)
echo $_SERVER['REQUEST_URI']; // outputs /
Zend_Debug::dump(parse_url($_SERVER['REQUEST_URI'])); // outputs array(["path"] => string(1) "/")
I am using Zend Framework but I doubt its something to do with it.
Thanks in advance.
You can’t parse that with PHP, for the simple reason that as far as the URL concerns, anything beyond the
#(hash) is not part of the URL, that part must be parsed with JavaScript or a similar client side language.Will return everything past the hash (including the
#character)In short: not possible in server, go with client. (maybe post an ajax call to a server with the GET data)