Posted by Toby Inkster on 03/23/06 01:20
wes wrote:
> Thanks, i have a solution that works in a similar way. I have another
> question. I have checkboxes in a php script. The number of checkboxes
> depends on the number of records in my database.
I'd do something like this:
<?php
$i = 0;
foreach ($database_rows as $r)
{
$i++;
print "<input type=checkbox value=1 name=chk$i>\n";
}
print "<input type=hidden value=$i name=nchk>\n";
?>
then the reading script does:
<?php
$number_of_checkboxes = $_REQUEST['nchk'];
for ($i=1; $i<=$number_of_checkboxes; $i++)
$chk[$i] = $_REQUEST['chk'.$i];
?>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|