View Single Post
Old 01-15-2008, 03:36 AM   #2 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

That code actually works perfectly for me. This is what I have:

php Code:
<?php

if(isset($_POST['submit']))
{
    foreach($_POST['deletebox'] as $deletebox1)
    {
        $deletebox1 = (int) $deletebox1;
        echo "DELETE FROM private_messages WHERE id=$deletebox1" . '<br />';
    }
}

?>

And the HTML...

html4strict Code:
<form action="" method="post">

    <input type="checkbox" class="delete-checkbox" value="1" name="deletebox[]" />
    <input type="submit" name="submit" value="delete messages" />

</form>

I can really only surmise that either the $_POST array is being overwritten, or that for whatever reason there are no items being posted, but I'm not sure why that would be. Is your code getting to that segment where you execute the SQL statements?
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote