My apologies,

I was playing with the code and changed something before sending...

Where it reads <INPUT TYPE=\"CHECKBOX\" SELECT NAME=\"$p[$trade]\" the array should 
actually read p$trade

Peace,
Michael


----- Original Message ----- 
From: Michael Benbow 
To: [EMAIL PROTECTED] 
Sent: Tuesday, July 03, 2001 7:02 PM
Subject: Processing checkboxes in Dynamic tables


I have a solution to my problem already, but I am looking for a far more economical 
way of doing this.

Currently my first page is four seperate tables with about 25 or so entries in each.  
I have gone through and automatically allocated the name p101 through p125 to the 
checkboxes for the first table, p201 through p225 to the checkboxes for the second 
table, etc.

The user makes selections from each table, but seldomly selects the majority.  They 
choose which lines they want processed then continue.

My problem is that with the above solution there are automatically 200 variables being 
passed from page to page, regardless of how many boxes are checked.  The average 
amount of boxes may be 10-15, and rarely is it more than 20.

Currently my code looks like the following...

    $trade=101;
  $result = mysql_query("SELECT * FROM $table_name WHERE ......");
 
  if ($row = mysql_fetch_array($result)) {

   do {
   
    echo "<tr bgcolor=\"#CBCFFF\">\n";
    
    echo "<td valign=\"top\" nowrap><font size=\"-2\">";
     echo "<INPUT TYPE=\"CHECKBOX\" SELECT NAME=\"$p[$trade]\" OPTION 
VALUE=\"$row[playerid]\">";
     echo $trade;
    echo "</td>\n";

    ..... 
    $trade=$trade+1;
    ..... 

    } while.....
  
    etc.

Could someone please help me so only the variables which are checked before the submit 
button is pressed are parsed, eg p102, p107, p117, rather than every input variable 
which is initialised on the site?

Thank you heaps in advace,
Michael.

Reply via email to