selection from an iterative list question
| From: | Bruce Douglas | Date: | Sun, 11 May 2003 05:39:40 +0000 |
| Subject: | selection from an iterative list question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147187@lists.php.net to get a copy of this message | ||
Hey....
I turn to you guys to get some opinions.... I've been grappling with this
for a little while!!!
I have a list of pictures with descriptions..... the list might range from
200-5000 items. It's currently displayed on either multiple pages or as one
long/large list on one page..... I'm trying to determine what might be the
best way to let the user select the items that he wants from the list.
My current options:
1) I can create a dropdown list which would let the user select all the
items he wants. This might work, but the list would be large and the user
wouldn't be able to see the pic as he scrolls through the list.
2) I could let the user go down the pic/description list, and put a checkbo
for each item. the user would have to press some sort of submit button, and
the page would be redrawn, but it could work...
Any other options/opinions would be appreciated. Or if anyone could point to
a site where this issue is already resolved so i could see how someone else
has approached this issue...
Thanks
Bruce
bedouglas@earthlink.net
-----Original Message-----
From: Paul Chvostek [mailto:paul+php@it.ca]
Sent: Saturday, May 10, 2003 9:43 PM
To: Ryan A
Cc: php-general@lists.php.net
Subject: [PHP] Re: counting check boxes
On Sat, May 10, 2003 at 09:39:50PM +0200, Ryan A wrote:
>
> Yes, I know its an ugly form and its pretty unusual...
> but I am just trying to copy the functionality of this site:
>
http://hostfilter.com/plans_showresults.asp?price=30&diskspace=5&plat=All&Su
> bmit=Filter+It+%21&ps=20
> If you run the above query you will see a row of checkboxes and at the
> bottom a way to compare plans...thats exactly what i want to do...
> After going through their source i see their checkboxes are all named
> "planid" so i did the same for mine...
Unless you have the source code that procseses their forms, duplicating
their form style seems wrong.
> What do you suggest to get the same functionality?
How about the method I already suggested?
Check http://www.it.ca/~paul/checktest.php for an
example.
p
> ----- Original Message -----
> From: "Paul Chvostek" <paul+php@it.ca>
> To: "Ryan A" <ryan@jumac.com>
> Cc: <php-general@lists.php.net>
> Sent: Saturday, May 10, 2003 8:55 PM
> Subject: Re: counting check boxes
>
>
> > On Sat, May 10, 2003 at 08:35:25PM +0200, Ryan A wrote:
> > >
> > > I have run into a little problem, its hard to explain so am giving you
> the
> > > whole code below:
> > > I am getting a string to countchecks.php which is like:
> > > countchecks.php?id=154&id=198&id=505&id=809&id=1100
> >
> > Ugh.
> >
> > If you're stuck with this format, then you're going to have to parse
> > $_SERVER['QUERY_STRING'] manually, because repetitions of the same
> > variable will overwrite each other. So $_GET['id'] will be 1100, and
> > the other values will be lost.
> >
> > > taking that I have to format it into
> > >
> > > select * from asdf where id=154 and id=198 and id=505 and id=809 and
> > > id=1100;
> > >
> > > How can i do that?
> >
> > Why would you want to? How can 'id' have multiple values?
> >
> > Anyway, it would be something like:
> >
> > foreach (explode('&',$_SERVER['QUERY_STRING']) as $this) {
> > list($junk,$value)=explode('=',$this);
> > if ($junk=="id") $q.=" AND id=$value";
> > }
> > $q="SELECT * FROM asdf WHERE" . substr($q,5) . ";";
> >
> > > Below is the form that i am using...
> > ...
> >
> > It's an ugly form. You'd have an easier time if you put the checkbox
> > entities into an array, with:
> >
> > <form method="get">
> > ...
> > <input type="checkbox" name="id[]" value="154">154
> > <input type="checkbox" name="id[]" value="198">198
> > <input type="checkbox" name="id[]" value="202">202
> > <input type="checkbox" name="id[]" value="505">505
> > <input type="checkbox" name="id[]" value="809">809
> > <input type="checkbox" name="id[]"
> > value="1100">1100
> > <input type="submit" name="Submit" value="Submit
> > form">
> > </form>
> >
> > and processed it with:
> >
> > foreach ($id as $value) {
> > $q.=" AND id=" . $value;
> > }
> > $q="SELECT * FROM asdf WHERE" . substr($q,5) . ";";
> >
> > --
> > Paul Chvostek <paul@it.ca>
> > Operations / Abuse / Whatever
> > it.canada, hosting and development
> > http://www.it.ca/
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Paul Chvostek <paul@it.ca>
Operations / Abuse / Whatever
it.canada, hosting and development http://www.it.ca/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php