PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
//line 12 is below:
foreach($_POST['message_checkbox'] as $num => $m_id){
$sql = "DELETE FROM ".MESSAGES_TABLE." WHERE recipient = '".SESSION_USER."'
AND folder = 'inbox' AND id = ".$m_id;
$result = $database->query($sql);
} // end foreach
keeps giving me this:
Warning: Invalid argument supplied for foreach() in /home/inbox.php on line 12
<script language="JavaScript" type="text/javascript">
<!--
function function() {
if(document.inbox.mailaction.value=="foward"){
var checkbox_name = document.getElementsByName('message_checkbox[]');
var checked_total = 0;
var max = checkbox_name.length;
I AM GETTIN THE PROBLEM 2 LINES AFTER HERE ( THE IF(EVAL...)
for (var idx = 0; idx < max; idx++) {
if (eval("" + checkbox_name + "[" + idx + "].checked") == true) {
checked_total += 1;
}
}
if(checked_total>1){
alert("You selected " + checked_total + " messages, you can only foward one message at a time. Please only select one message.");
return false;
} else {
return true;
}
}
}
-->
</script>