Pass variable from jQuery to PHP
<p>I created a script to read a hash (www.website.com/#hash) and pass the hash in to php.
The <code>alert(hash)</code> pops up with the hash value, but the hash is not being echoed out in the post variable. Any idea why?</p>

<p><strong>jQuery page</strong></p>

<pre><code>&lt;script&gt;
    var hash = location.hash;
    $.post("community.php", {
        hash: hash
    });
    alert(hash);
&lt;/script&gt;
</code></pre>

<p><strong>Community.php page</strong></p>

<pre><code>&lt;?php echo $_POST['hash']; ?&gt;
</code></pre>

<p><br /><br /></p>

<blockquote>
  <p><strong>Edits</strong> - $_GET below was originally $_POST above.</p>
</blockquote>

<p>I have a foreach that is looping through postings (posting IDs) in a function. I need to pass the HASH into the function and compare it to the posting IDs everytime. Only problem is, the $_GET['hash'] will not show up inside the function.</p>

<pre><code>function something() {
   echo $_GET['hash'];
}
</code></pre>
