Need to populate a php variable with a select box

So, I’m new to php, and web design as a whole. I’m trying to use a select box with 4 options, 1-4, and want to generate tables based on the selection. I’m using a for() loop to generate the tables, but I need to get the select box value into the $numTables variable and have it update the form dynamically. If I hard code a value into the $numTables variable, it displays the tables no problem. If someone can help me see what I’m probably not seeing, it would be greatly appreciated, and you will get much good Karma.

This is the function I’m referencing in my code:

function Update(boxSelection){
  var frm = document.getElementById("form1");
  frm.$numTables = boxSelection;
}

and here is the php:

[php]

<?php $numTables = 1; $tableCtr = 1; echo '

How many would you like? // Here's where I call the Update function 1 2 3 4 For more than four, please contact us!

'; echo ''; // the exterior table // Here is where my for() loop uses the $numTables variable as a check, I need it populated by the select box as it will then display the interior tables for ($tableCtr = 1; $tableCtr<=$numTables; $tableCtr++) { echo 'Award '; echo $tableCtr; echo '
'; echo ''; echo ''; echo ''; echo ''; // CODE TO DISPLAY INTERIOR TABLE(s) $ctr = 1; $numlines = $_SESSION['num_lines']; for ($ctr = 1;$ctr<=$numlines;$ctr++) { echo ''; echo ''; echo ''; echo ''; } echo '
Enter Text:Select a Font
'; echo ' '; echo ''; echo ''; echo ''; echo ''; do { echo ''; echo $row_Recordset4['font_name']; echo ''; } while ($row_Recordset4 = mysql_fetch_assoc($Recordset4)); $rows = mysql_num_rows($Recordset4); if($rows > 0) { mysql_data_seek($Recordset4, 0); $row_Recordset4 = mysql_fetch_assoc($Recordset4); } echo ''; echo '
'; echo ''; } ?>
           </table>
[/php]

Thank you, in advance for any help you can provide.

try this :

[php]

How many would you like?

1 2 3 4 For more than four, please contact us!
[/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service