Passing Javascript variables in php
<p>I have 2 pages: details.php and terrainChooser.php</p>

<p>Terrain Chooser creates a td tag with an element and adds to it 3 input type="hidden" with information to retrieve.</p>

<pre><code>window.opener.document.getElementById(elementID).innerHTML = "
&lt;input readonly type='text' style='background-color:#eed8bb;border:0;' name='parcName" + parcNum + "' value=\"" + txt + "\" /&gt;
&lt;input type='hidden' id='parcId" +parcNum + "' value='" + id + "' /&gt;
&lt;input type='hidden' id='regID" + parcNum + "' value='" + regID + "' /&gt;
&lt;input type='hidden' id='muni" + parcNum + "' value=" + muni +" /&gt;";
</code></pre>

<p>Inside details, they have been retrieved for a purpose and are used to display the values of the 3 input type hidden.</p>

<p>My question is, how do i go about using those javascript variables to say pass them through an sql statement in my php part say:</p>

<pre><code>$SQL = "update T_TOURNOI_PARC set
F_PARCID1 = $parc[0],
WHERE F_TOURNOIINFOID = $tournoiId";
$rs-&gt;execute($SQL);
</code></pre>

<p>Where $parc[0] would have the 3 values.</p>

<p>This doesn`t work but is there something like this i can use?</p>

<pre><code>&lt;script type="text/javascript"&gt;
/* &lt;![[CDATA */
var test = document.getElementById['muni1'].value
/* ]]&gt; */
&lt;/script&gt;
&lt;?php
$test = ('&lt;script type="text/javascript"&gt;test&lt;/script&gt;');
?&gt;
</code></pre>
