Jump to content

Archived

This topic is now archived and is closed to further replies.

nominator

php+checkbox

Recommended Posts

Hi, i alot a db table called "staff". it has all the staff details, eg username, pass, email etc etc.

Under my admin page, i wanna allow admins to delete staff. i wanan output all staff username and a checkbox at the side. If the checkbox is ticked, the staff is deleted from database. If example 5 staffs are ticked, all 5 staff will be remove from db

How do i prin all records with a checkbox at the side and delete when ticked

thanks in advance

Share this post


Link to post
Share on other sites
there are several very recent threads about this very topic. please try searching before posting. k thx.

Share this post


Link to post
Share on other sites
Short Answer:

[code]USER 1 <input type="checkbox" name="delete[1]">
USER 2 <input type="checkbox" name="delete[2]">[/code]
You'll get something like:
[code]Array
(
    [delete] => Array
        (
            [1] => on
        )

)[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.