mix javascript and php
<p>i have file: <strong>file.php</strong></p>

<p>in this file is:</p>

<pre><code>&lt;script type="text/javascript"&gt;
//....
var sumJS = 10;

&lt;?php $sumPHP = sumJS  ?&gt;

&lt;/script&gt;
&lt;?php echo "Sum = " . $sumPHP ?&gt;
</code></pre>

<p>How can i assign sumJS for $sumPHP ?</p>

<p>if i would like make this conversely then i make:</p>

<pre><code>$sumPHP = 10;
&lt;script type="text/javascript"&gt;
var sumJS;
sumJS = &lt;?php echo $sumPHP ?&gt;;
alert(sumJS);
&lt;/script&gt;
</code></pre>

<p>but how can i make this for my problem?</p>
