• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
synchronise $_post and $_files

#1
[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

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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.