/    Sign up×
Community /Pin to ProfileBookmark

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”];
}[/CODE]

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.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Phill_PaffordJul 28.2008 — best post I have seen on this subject

http://www.daniweb.com/forums/thread62874.html
Copy linkTweet thisAlerts:
@Phill_PaffordJul 28.2008 — sorry this is the other link which does a better job

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

Success!

Help @memerson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...