CodeIgniter Forums
synchronise $_post and $_files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: synchronise $_post and $_files (/showthread.php?tid=15123)



synchronise $_post and $_files - El Forum - 01-27-2009

[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


synchronise $_post and $_files - El Forum - 01-27-2009

[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 !!


synchronise $_post and $_files - El Forum - 01-27-2009

[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.