Jump to content

php+checkbox


nominator

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
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.