title: Passing javascript variable into php code without using GET parameters?
body: <p>is there any way to get js variable in php, i try something funny like this:</p>
  
  <pre><code>&lt;script&gt;
  var x = "random text";
  alert("aaa&lt;?php echo md5(;?&gt;"+x+"&lt;?php); ?&gt;");
  &lt;/script&gt;
  </code></pre>
  
  <p>Of course it gives me error. </p>
  
  <pre><code>Parse error: parse error, expecting `')'' in X:XXX\index.php on line XXX
  </code></pre>
  
  <p>If there is a way without refreshing the page or using GET parameters, please let me know. Thanks</p>
  
  <p>EDIT:</p>
  
  <p>What I am trying to do is: hash(md5 inside php) the javascript variable.</p>