Re: Deleting multiple items from database using checkboxes
| From: | Marco Tabini | Date: | Mon, 07 Oct 2002 20:08:14 +0000 |
| Subject: | Re: Deleting multiple items from database using checkboxes | ||
| References: | 1 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-general+get-119135@lists.php.net to get a copy of this message | ||
Try WHERE EntryID IN (" . implode ($dele, ',') . ")"
However:
1) Anybody could fake a form post or query url to delete any data in
your database
2) It would also be possible to create a more dangerous post that could
give the attacker control over your entire database
Thus, I assume that you will want to put a *lot* of checking around that
code!
Marco
On Mon, 2002-10-07 at 16:05, Davy Obdam wrote:
> Hi people,.
>
> I have a guestbook admin page were i would like to delete one item or
> more items from the database if necessary. I have modified my normal
> guestbookpage so that it has checkboxes in front of every entry. This is
> my code:
>
> <input type=\"checkbox\" name=\"dele[]\"
> value=\"".$sql['entryID']."\">
>
> Now i can select multiple items. But i have tried to delete em, but it
> only deletes one item from the database, my query looks like this :
> DELETE FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
> for your time.
>
>
> Best regards,
>
> Davy Obdam,
> mailto:info@davyobdam.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>