Re: looping through values from a field? Need hellp.
| From: | Lars Torben Wilson | Date: | Sat, 05 Jul 2003 22:59:13 +0000 |
| Subject: | Re: looping through values from a field? Need hellp. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154082@lists.php.net to get a copy of this message | ||
On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
> I have this javascript that enables browsing and selecting of a file. This
> file location and name are then transferred further down in the form as an
> <option>. Multiple files may be chosen as they are just added one below the
> other. Anyway, when the form is submitted it is only retrieving the last
> file name from the form. How can I get PHP to return all the values from
> the <select> part. Basically this is what is happening:
>
> 1. Choose a file <input type="file" name="viewing"
> onchange="loadImg();">
> 2. File location and name are displayed in the
> <select name="imgList" style="width:350;" size="6"
> multiple></select> as
> <option value="c:\images\filename.gif">c:\images\filename.gif</option>
> The javascript creates the option and a new option is added and appended
> when a new file is chosen.
> 3. Submit form to php script to send location and stuff to database.
>
> Anyone have any ideas of how I can get PHP to loop through and pull out each
> option value? They are separated by a comma. Right now, it only grabs the
> last file even though all files are highlighted before submission.
>
> thanks
http://ca2.php.net/manual/en/faq.html.php#faq.html.select-multiple
Hope this helps,
Torben
--
Torben Wilson <torben@php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----