I am using the following piece of Javascript code to get the link from the browser:
<script type="text/javascript">
document.write(document.URL);
</script>
How can I pass the value to PHP or get the link to use it on PHP code?
Please, that's just what I want to know, I do not want other answers about how I can get the link directly through php. I know already that there are ways to get the link through PHP directly by useing $_GET
, $_SERVER
but they do not get the link with the hash and I want get the value after the hash.
I.e.: http://sitename.com/t10.html#post22