Well cien there could be several checkboxes you can create an array for all of them.
Ill use your example above:
/*************************************/
<form method=POST>
<?php
for($k=0; $k < pg_numRows($res); $k++ ) {
$nome_disc = pg_Result($res, $k,0);
echo "<input type=checkbox name=disc[] value=$nome_disc[$k]>". pg_Result($res, $k,1 ). "<br>";
}
echo "<input type=submit value=OK >";
echo "</form>";
?>
/*************************************/
1.) the checkbox names has be be an array, so we add [] to the end of the name.
2.) in your pg_result() you need to use a . instead of a , to escape from the string then reenter (this could of been a typo)
Now to get the results of disc[] you would do something like:
for ($x=0; $x < count($HTTP_POST_VARS['disc']); $x++) {
if ($HTTP_POST_VARS['disc'][$x] != '') {
// Do what you want here.
// $HTTP_POST_VARS['disk'][$x] is the value
// of a checkbox.
}
}
Like before we just looped through the disk checkbox's. All of the ones that were checked are stored in $HTTP_POST_VARS['disc'] as an array. So all you have to do is loop through the array to get the value of each checkbox that was checked.
Hope this helps and make sense 🙂
Derek