www.webdeveloper.com
Results 1 to 3 of 3

Thread: Using loops to list checkbox values

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Location
    Bristol
    Posts
    77

    Using loops to list checkbox values

    I'm pretty stuck here...

    I have a script that generates a list of domains when someone searches, it uses an API call from Enom (a domain reseller) and prints availability of the domains and domain suggestions. There are checkboxes next to each called "buy" which, once checked, will allow the user to proceed to checkout. However, I need to create some kind of loop to find out which and how many checkboxes have been checked. Since the checkboxes are dynamically created I do not know how many there will be. I want to use sessions to create a shopping trolley and so far I have this:

    Code:
    if(!isset($_SESSION["domain"]) {
         $_SESSION["domain"] = $_POST["buy"];
    }
    where the value of "buy" is the domain name taken from the checkbox. This will set a session fine if only one box is checked but how do I do it to incorporate the setting of several sessions if more than one box is checked? If anyone needs to know anything else to help in this matter, just ask.

    Thanks.

  2. #2
    Join Date
    Aug 2006
    Location
    Michigan
    Posts
    1,046
    best post I have seen on this subject

    http://www.daniweb.com/forums/thread62874.html

  3. #3
    Join Date
    Aug 2006
    Location
    Michigan
    Posts
    1,046
    sorry this is the other link which does a better job

    http://www.daniweb.com/forums/thread62312.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles