Ok, just talking in general here, but you should get the point.
If you look in the
hacks database you will see something like this:
Code:
<tr align="center">
<td bgcolor="#13486D"><img src="https://vborg.vbsupport.ru/images/folder.gif" align="left"></td>
<td bgcolor="#1C5780" align="left" valign="top"><font face="verdana" size="2">[high]<input type="checkbox" name="install[34534]" value="yes" checked>[/high] <a href="index.php?s=&action=showhack&hackid=73">List similar usernames when moderating user registration</a></font></td>
<td bgcolor="#13486D"><font face="verdana" size="2"><a href="https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=3771">dlst</a></font></td>
<td bgcolor="#1C5780" nowrap><font face="verdana" size="1">01-27-02<br><font color="#FF9C58">08:07 PM</font></font></td>
<td bgcolor="#13486D" nowrap><font face="verdana" size="1">01-27-02<br><font color="#FF9C58">08:07 PM</font></font></td>
<td bgcolor="#1C5780"><a href="javascript:whoinstalled(34534)"><font face="verdana" size="2">1 user</font></a></td>
<td bgcolor="#13486D"><img src="https://vborg.vbsupport.ru/images/clear.gif" border="0" alt="0 votes - 0.00 average"></td>
</tr>
[high]<input type="hidden" name="all[34534]" value="1">[/high]
So you can see I put two fields for each hack, one is a part of an array all[], which eventually has all the ID's of the hacks in that page. The value of that field is either 0 or 1. 1 if the user already installed the hack, and 0 if he hasn't.
Then there's the real checkbox, that the user can change. That's part of the install[] array, which holds all the ID's of the hacks the user WANTS to have installed.
And here's a little bit of code from the page itself, that parses the results:
PHP Code:
while (list($threadid,$was)=each($all)) {
$now=$install[$threadid];
if ($now=='yes' and $was=='0') {
// Here I install the hack!
} elseif ($now!='yes' and $was=='1') {
// Here I un-install the hack!
}
}
I'm listing the stuff from the all[] array, that has the ID's of the hacks and the state (installed or not) BEFORE the submit, and put the 1/0 into $was (meaning what WAS the state). Then I'm taking the value of the install[] with the current ID and put it into $now (which represents the state as it NEEDS to be).
And then it's really simple logic! If the hack wasn't installed ($was equals 0) and it SHOULD be now ($now equals yes), then we need to install the hack.
Otherwise, if the hack WAS installed ($was is 1) but the user un-checked the box (so $now is not yes), we need to un-install the hack.
If non of the above is true, it means that the hack is either already installed and the user didn't touch the checbox, or it is not installed but the user didn't check the checkbox neither.
*takes a deep breath*

Did I say I was talking in general?