Pass javascript variable to php code?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/406316/how-to-pass-a-variable-data-from-javascript-to-php-and-vice-versa">How to pass a variable / data from javascript to php and vice versa?</a>  </p>
</blockquote>



<p>I have a file of php and javascript code. I want to set a php variable to be the result of a javascript function which takes a php variable as a parameter. For example: </p>

<pre><code>$parameter = "this is a php variable";
$phpVar = echo "foo(" . parameter . ");";
</code></pre>

<p>I know you cannot do a "= echo", is there another way I can do this?</p>

<p>Thanks</p>
