I am trying to get the url of the current page along with the number after #. I am useing this to get the #number: var hash = window.location.hash;
. But i want to pass it to a php variable. I used cookies to take the variable from javascript and pass it to php but my webpage remains 2 steps back till echo the value. What other possibilites I have to pass a variable to php. Below is the code i used.
<script>
var hash = window.location.hash;
document.cookie="hash="+hash;
</script>
<?php
$hash='';
if(isset($_COOKIE['hash']))
$hash=$_COOKIE['hash'];
?>