Jacky wrote:
> 
> Hi all
> I have a form with the checkbox like this
> <form>
> $query="select id from foo";
> $result=($query,$con);
> while ($row = mysql_fetch_array($result))
>      {
> <input type="checkbox" name="$id" value="on">
>      }
> ....submit button and stuffs here...
> </form>

One possibility:
Add a hidden field in the form and write all names of the checkboxes in
it, separated by a semicolon, for example.
-----------------------------------------------------------------------------
<form>
$query="select id from foo";
$result=($query,$con);
while ($row = mysql_fetch_array($result))
{
<input type="checkbox" name="$id" value="on">
$names_of_checkboxes.=$id.";";
}
<input type="hidden" name="names_of_checkboxes" value="<? echo
$names_of_checkboxes; ?>">
 ....submit button and stuffs here...
 </form>
-------------------------------------------------------------------------------
Then, in the next page you just do following:
---------------------------------------------------------------------------
$checkboxes_names_array=explode(";",$names_of_checkboxes);
for($x=0;x<count($checkboxes_names_array);$x++)
{
    if($$checkboxes_names_array[$x]=="on")
        // box checked
}
-------------------------------------------------------------------------------

Robert

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to