title: Access a JavaScript variable from PHP
body: <p>I need to access a <strong>JavaScript</strong> variable with <strong>PHP</strong>. Here's a stripped-down version of the code I'm currently trying, which isn't working:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
      var test = "tester";
  &lt;/script&gt;
  
  &lt;?php
      echo $_GET['test'];
  ?&gt;
  </code></pre>
  
  <p>I'm a completely new to both JavaScript and PHP, so I would really appreciate any advice.</p>
  
  <p><strong>UPDATE</strong>: OK, I guess I simplified that too much. What I'm trying to do is create a form that will update a Twitter status when submitted. I've got the form working OK, but I want to also add geolocation data. Since I'm using Javascript (specifically, the Google Geolocation API) to get the location, how do I access that information with PHP when I'm submitting the form?</p>