CodeIgniter Forums

Full Version: synchronise $_post and $_files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]tim1965[/eluser]
Hi


I have a multi file upload script that loops thru the $_files array, renames the files, creates thumbnail's, moves the files to a specific user directory, and then inserts the filenames into a database.
I now want to add a textbox in my view for user comments on each image (i.e. 8 images to upload with 8 comments attached), on my view for each image to be uploaded.

So the problem i am grappling with is how to get the value of $_post and ensure the key values are in step i.e. process image 1 with textfield 1.

I am sure theres a relatively easy way to handle this but its stumping me. Maybe i need some more coffee !!

Any pointers in the right direction would be appreciated.
If you need to see my current code to help then let me know.
Many thanks

El Forum

[eluser]tim1965[/eluser]
As an add on is there any way to append POST data to the FILES array ? i.e. could i name the textfields to something like $_files['photo_desc[]'] to force them into that array ?
Heres hoping !!

El Forum

[eluser]umefarooq[/eluser]
yes you can do the textfields using name as array for example <input type="text" name="comment[]" /> than you can get the array in post like this $_POST['comment'] best way to check that you data is in array or not is to use like this print_r($_POST['comment']); it will sure work.