RE: [PHP-DB] Passing multiple form variable in PHP

From: Date: Tue, 12 Nov 2002 16:40:25 +0000
Subject: RE: [PHP-DB] Passing multiple form variable in PHP
Groups: php.db 
Request: Send a blank email to php-db+get-23245@lists.php.net to get a copy of this message
> -----Original Message----- > From: Stephen Rhodes [mailto:stephen.rhodes@scils.co.uk] > Sent: 12 November 2002 16:32 > > Wanting to use <select multiple ... > in a html form and pass > multiple value > into a php variable but does > not work. I only get a single value. Can you tell me what I > am doing wrong > ????? You're not telling PHP to expect multiple values -- this is done by putting array brackets [] on the end of the field name. > > Does the multiple value get passed correctly in php ???? Yes. > <select multiple name="icon"> Needs to be: <select multiple name="icon[]"> and $_POST['icon'] will be an array of the selected values. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.db (#23245) next »