Re: how to user <select multiple="true">

From: Date: Wed, 16 Oct 2002 01:39:06 +0000
Subject: Re: how to user <select multiple="true">
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120090@lists.php.net to get a copy of this message
Heres an example from the Variables from outside PHP section of the PHP docs. <form action="array.php" method="post"> <select multiple name="beer[]"> <option value="warthog">Warthog <option value="guinness">Guinness <option value="stuttgarter">Stuttgarter Schwabenbräu </select> <input type="submit"> </form> So basically you need to add the [] to the name. So in this example your results will come back as an array: $beer = array("warthog", "guinness"); if you select the first two items. Cheers, Owen Prime http://www.noggin.com.au Khalid El-Kary wrote: > hi, > If i have a form that has a <select> with multiple="ture" how would i be > able to retireve it's multiple values in the PHP script, i tried the > $_REQUEST['fieldname'] it gave me only the last selected value > > note: multiple selection is done by holding ctrl :) > > khalid > > > > _________________________________________________________________ > Unlimited Internet access -- and 2 months free! Try MSN. > http://resourcecenter.msn.com/access/plans/2monthsfree.asp

« previous php.general (#120090) next »