I used this method I'd read about when I first started programming PHP
<input type=checkbox name=mychecks[]>Include this item
<input type=checkbox name=mychecks[]>Use bold font
<input type=checkbox name=mychecks[]>Existing customer
Etc.
What I found was that I needed a scorecard to later figure out what I was handling:
if($mychecks[0]{
includethis();
}
if($mychecks[1]){
boldthis(mystring);
}
if($mychecks[2]){
$existingcustomer=1;
}
etc.
But this meant that I had to adjust the colding everytime I changed the interface. If I moved checkbox 1 and 2 for example. I also had to change the if statement:
if($mychecks[1]{
includethis();
}
if($mychecks[0]){
boldthis(mystring);
}
Better is:
<input type=checkbox name=mychecks['include']>Include this item
<input type=checkbox name=mychecks['bold']>Use bold font
<input type=checkbox name=mychecks['existing']>Existing customer
Then they could be moved with no change to a code like:
if($mychecks['include']{
includethis();
}
After a while I got tired of writing the array pieces, so my code is more like:
<input type=checkbox name=existing>Existing customer
then:
if($existing){
$existingcustomer=1;
}
Of course I leave register globals on, so shoot me.
If off, I'd be saying:
$mychecks=$_POST['mychecks'];
etc