I have two questions, never been working with checkboxes this is why I'm puzzled.
Anyways:
Can you put a variable into a $REQUEST[''] field? For instance $REQUEST['$index']?
The following code is supposed to delete the messages the user wants removed. He or she marks a checkbox/several checkboxes and presses 'delete'. This code is supposed to read all the checkboxes data coming in (I've limited the max amount of mail to 100). $duser is a session variable.
// Check if user really is the user who wants to delete comment
$a=0;
while( $a <= 100 ){
$id = $_REQUEST['$a'];
$result = @mysql_query("SELECT tuser FROM pm WHERE id = '$id'");
$userfetch = mysql_fetch_array($result);
$user = $userfetch['tuser'];
$a++;
if ($user == $duser) {
// Delete thread
@mysql_query("DELETE FROM pm WHERE id ='$id'");
mysql_query($sql2);
}
}
Pardon the bad format. :rolleyes:
Also sorry about my English, it's not my native language. Hope someone could help me out with this.
Kristofer