Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Populate the value of an input field with $_FILES['field']['name'];
#1

[eluser]Ludovic-r[/eluser]
I need to retrieve in an Array the value of an upload input field, let me explain :

I have these inputs fields :

Code:
<input type='text' name='field["+ j++ +"]' value='' data-kind='title' />
<input type='file' name='field["+ j++ +"]' value='' data-kind='image' />
<input type='text' name='field["+ j++ +"]' value='' data-kind='title' />
<input type='file' name='field["+ j++ +"]' value='' data-kind='image' />

I print_r the field array from those fields and get that :

Code:
Array
(
    [0] => title 1
    [2] => title 2
)

instead of :

Code:
Array
(
    [0] => title 1
    [1] => image1.jpg
    [2] => title 2
    [3] => image2.jpg
)

I need to have my filenames in my array, how can I have this second array?

I've tried a merge but I need to preserve the place of each fields in the array like the order of each input in the form (example : if the upload field is generated at the first place of the form I need to keep that information in the Array ([0] => image1.jpg [1] => title1 and so on)

Any would help would be very very appreciated!! I'm stuck since few days on that Sad


Messages In This Thread
[SOLVED] Populate the value of an input field with $_FILES['field']['name']; - by El Forum - 10-13-2011, 01:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB