abcd.com/indexreadmore.php?#cat2
This is what the url in which I want to get all the parts like above mentioned, I can get a bit but not able to get the #cat2
and help me fetch entire url in php from the url bar.
abcd.com/indexreadmore.php?#cat2
This is what the url in which I want to get all the parts like above mentioned, I can get a bit but not able to get the #cat2
and help me fetch entire url in php from the url bar.
#
in PHP..The maximum you can attain is abcd.com/indexreadmore.php
, To verify this you could just do a print_r($_SERVER);
on your PHP code.
The content after the #
can be retrieved only through JavaScript.
The hashtags are not sent to the server, only the browser so PHP wouldn't be able to parse that from the address. You'd have to use javascript:
<script type="text/javascript">alert(window.location.hash);</script>