Hi,
I have writen an email program, which picks up my email via imap/pop3. It displays the headers in a hotmail style layout. i.e.
checkbox|subject|from|date|size
The checkbox has name=chackbox value=accountid,messageid. When its checked, and you press 'Delete Message' it runs my function delete_message, which looks like.
function delete_mail($checkbox){
global $feedback;
$id = explode(",",$checkbox);
$sql="SELECT * FROM email where id='".$id[0]."'";
$result=db_query($sql);
if (!$result || db_numrows($result) < 1) {
echo '<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Sorry Account Currently Unavailable</font></div>';
return false;
} else {
while($row=mysql_fetch_array($result)){
$name = $row['name'];
$host = $row['host'];
$user = $row['user'];
$pass = $row['pass'];
$port = $row['port'];
$type = $row['type'];
@$imap = imap_open("{".$host."/".$type.":".$port."}INBOX", $user,$pass);
imap_delete($imap, $id[1]);
imap_expunge($imap);
imap_close($imap);
$feedback .= " Message ".$id[1]." deleted from mailbox: - $name ";
}
}
}
How can i change this, so if more than 1 checkbox is checked, when you press delete, it deletes multiple messages? I can't change the checkbox name, because I have a javascript on the inbox page, so when u check 1 main checkbox at the top, it checks them all, like on hotmail, and it only works if all the checkboxs have the same name.
Regards
Ben