another way, maybe easier to understand...
Each of the check boxes should look something like this:
Code: Select all
<input type=checkbox name=FilesToDeleteї] value=$filename>
All of the checkboxes will have the exact same name.... notice the [] after the name of the checkbox? This tell PHP that this is an array, and sets the value of the next array item to the value of the checkbox (i.e. filename) if it is checkedS... make sense?
if you use the GET method, your address bar will look something like:
Code: Select all
http://what.com/test.html?FilesToDelete%5B%5D=file1.ext&FilesToDelete%5B%5D=file2.ext&FilesToDelete%5B%5D=&FilesToDelete%5B%5D=file4.ext
a little more readable:
Code: Select all
http://what.com/test.html?FilesToDeleteї]=file1.ext&FilesToDeleteї]=file2.ext&FilesToDeleteї]=&FilesToDeleteї]=file4.ext
PHP sees:
Code: Select all
$FilesToDeleteї]="file1.ext";
$FilesToDeleteї]="file2.ext";
$FilesToDeleteї]="";
$FilesToDeleteї]="file4.ext";
and you get:
Code: Select all
$FilesToDeleteї0]="file1.ext";
$FilesToDeleteї1]="file2.ext";
$FilesToDeleteї2]="file4.ext";
this is the way i deal with checkboxes in this kind of situation, but as usual, there is more than one way to do it.
c.w.collins