Q:

Passing Javascript variables in php

I have 2 pages: details.php and terrainChooser.php
Terrain Chooser creates a td tag with an element and adds to it 3 input type="hidden" with information to retrieve.
window.opener.document.getElementById(elementID).innerHTML = "
<input readonly type='text' style='background-color:#eed8bb;border:0;' name='parcName" + parcNum + "' value=\"" + txt + "\" />
<input type='hidden' id='parcId" +parcNum + "' value='" + id + "' />
<input type='hidden' id='regID" + parcNum + "' value='" + regID + "' />
<input type='hidden' id='muni" + parcNum + "' value=" + muni +" />";

Inside details, they have been retrieved for a purpose and are used to display the values of the 3 input type hidden.
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:
$SQL = "update T_TOURNOI_PARC set
F_PARCID1 = $parc[0],
WHERE F_TOURNOIINFOID = $tournoiId";
$rs->execute($SQL);

Where $parc[0] would have the 3 values.
This doesn`t work but is there something like this i can use?
<script type="text/javascript">
/* <![[CDATA */
var test = document.getElementById['muni1'].value
/* ]]> */
</script>
<?php
$test = ('<script type="text/javascript">test</script>');
?>

A:

You should put the inputs in a form and post them to another script to handle the parameters. Take a look at http://www.tizag.com/phpT/forms.php 

