get #var from url in php code error
<p>i want to get <code>#var</code> value from url like my url is <code>mydomain.com/index.php#1</code> so i want to get has(#) value from url which is <code>1</code> after some research i got this article <a href="http://www.stoimen.com/blog/2009/04/15/read-the-anchor-part-of-the-url-with-php/" rel="nofollow">http://www.stoimen.com/blog/2009/04/15/read-the-anchor-part-of-the-url-with-php/</a></p>

<p>i use this code for get has(#) value, this is work fine in <code>JavaScript</code>  but this is not work in <code>php</code> my code is :</p>

<pre><code>&lt;script language="javascript"&gt;
var query = location.href.split('#');
document.cookies = 'anchor=' + query[1];
alert(query[1]);
&lt;/script&gt;
&lt;?php
echo $_COOKIE['anchor'];
?&gt;
</code></pre>

<p>this code give me <code>alert</code> value in <code>JavaScript</code> but not <code>echo</code> value. any solution for that ?</p>
