i want to get #var
value from url like my url is mydomain.com/index.php#1
so i want to get has(#) value from url which is 1
after some research i got this article http://www.stoimen.com/blog/2009/04/15/read-the-anchor-part-of-the-url-with-php/
i use this code for get has(#) value, this is work fine in JavaScript
but this is not work in php
my code is :
<script language="javascript">
var query = location.href.split('#');
document.cookies = 'anchor=' + query[1];
alert(query[1]);
</script>
<?php
echo $_COOKIE['anchor'];
?>
this code give me alert
value in JavaScript
but not echo
value. any solution for that ?