Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do I create a check box?

    i have a newbie question...
    I want to make a checkbox table consisting several attributes
    i know how to declare type as "checkbox"
    so declaring each of my attributes as "checkbox"
    and then when checkbox is marked , how do I put all the check ones into one table?

    for example, a user checked photography, movies, sports as true...
    how do I make it so that the user has true value for those 3 attributes and false for all the
    other unchecked ones?
    sorry, im very noob =/

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Welcome here !

    What do you mean by
    and then when checkbox is marked , how do I put all the check ones into one table?
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think you need to understand what PHP is and where its engine sits in the scheme of things:

    The user sees a form, HTML form even, with checkboxes organized in a table. There has to be a submit button somewhere to POST/GET the form to a PHP script file. It is at this point that the PHP script will run.

    In your PHP script, you can access the checkbox variables by their name through the post array: $_POST["checkbox_variable_name"]

    One thing to note about checkboxes is that if they are not checked, they will not post themselves to the PHP script (ie. they will not exist in $_POST[]).

    Check out this link for some more insight:
    http://www.onlamp.com/pub/a/php/2003...undations.html

    Hope that helps,
    Sadiq.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •