I have an approval page for approving reviews, and the current way I work out if checkboxes is pretty crappy.
HTML
<input type="checkbox" name="1">(html removed)
<input type="checkbox" name="2">(html removed)
PHP
$approveArray = array();
for ($i = 1; $i <= 1000; $i++) {
$x = $_POST[$i];
if ($x == 'on') {
array_push($approveArray, $i);
}
}
Can anyone suggest a better way to do this? The id's i'm dealing with could get high enough, into the tens of thousands, so this could be a bit performance hit.
Thanks for any suggestions.