OZONE Asylum
Forums
Server-Side Scripting - Oh my!
getting assigned key from $_FILES array
This page's ID:
27968
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I have an upload form that allows the user to upload multiple files at once if they want to. I'm using name="photos[]" to have all the uploads in an array on submit. Without going into a huge explaination, I would like to number the keys in the form fields i.e [code] name="photos[1]" name="photos[3]" name="photos[7]" [/code] but I don't seem to be able to access the key after a submit. I want to do something like [code] foreach ($_FILES['photos'] as $key => $value) { echo $key.'<br />'; } [/code] and have it echo 1 3 7 but no matter what I try I don't seem to be able to access the key assigned in the field name. I tried var_dump($_FILES) and print_r($_FILES['photos']) and print_r($_POST) and I don't see the assigned field keys anywhere. Is this an impossible task? <edit> Had to put the code for the fields in UBB code tags or they got parsed for usernames. :p </edit> [small](Edited by [url=http://www.ozoneasylum.com/user/544]butcher[/url] on 05-21-2006 23:51)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail