Andy92
08-18-2007, 02:45 AM
Hi there,
Ive done php form processing before, but there is something im stuck on.
I have a form, and a php while loop, that connects to the database, and prints rows of data.
<input type='checkbox' name='inboxcheck[";
echo $foo++;
echo "]' value='$row2[id]' />
So, it would print, say eg ...
<input type='checkbox' name='inboxcheck[1]' value='7' />
<input type='checkbox' name='inboxcheck[2]' value='11' />
<input type='checkbox' name='inboxcheck[3]' value='17' />
<input type='checkbox' name='inboxcheck[4]' value='20' />
So then i select the textboxes, say i select inboxcheck[2] and inboxcheck[4]
Then, it goes to the process.php page, and this is what i have...
@extract($_POST);
$inboxcheck = stripslashes($inboxcheck);
echo $inboxcheck;
But, because i selected 2 and 4, instead of writing this...
@extract($_POST);
$inboxcheck[2] = stripslashes($inboxcheck[2]);
$inboxcheck[4] = stripslashes($inboxcheck[4]);
echo $inboxcheck[2];
echo $inboxcheck[4];
I dont know what checkboxes users are going to select, so is there any way of displaying the values of all the checkboxes they select like...
@extract($_POST);
$inboxcheck[numbers] = stripslashes($inboxcheck[numbers]);
echo $inboxcheck[numbers];
So as i selected 2 and 4, it will echo 11 and 20.
:confused::confused:
Ive done php form processing before, but there is something im stuck on.
I have a form, and a php while loop, that connects to the database, and prints rows of data.
<input type='checkbox' name='inboxcheck[";
echo $foo++;
echo "]' value='$row2[id]' />
So, it would print, say eg ...
<input type='checkbox' name='inboxcheck[1]' value='7' />
<input type='checkbox' name='inboxcheck[2]' value='11' />
<input type='checkbox' name='inboxcheck[3]' value='17' />
<input type='checkbox' name='inboxcheck[4]' value='20' />
So then i select the textboxes, say i select inboxcheck[2] and inboxcheck[4]
Then, it goes to the process.php page, and this is what i have...
@extract($_POST);
$inboxcheck = stripslashes($inboxcheck);
echo $inboxcheck;
But, because i selected 2 and 4, instead of writing this...
@extract($_POST);
$inboxcheck[2] = stripslashes($inboxcheck[2]);
$inboxcheck[4] = stripslashes($inboxcheck[4]);
echo $inboxcheck[2];
echo $inboxcheck[4];
I dont know what checkboxes users are going to select, so is there any way of displaying the values of all the checkboxes they select like...
@extract($_POST);
$inboxcheck[numbers] = stripslashes($inboxcheck[numbers]);
echo $inboxcheck[numbers];
So as i selected 2 and 4, it will echo 11 and 20.
:confused::confused: