I have form containing many input fields. But I need to take one field from form using foreach loop.
foreach ($_POST['image'] as $image):
//mysql query to insert
endforeach;
How can I take posted value for ‘image’ using for each loop? I need to get each image name using this foreach loop.
Thanks!
If you have used input type=”file” you have to check following things
your form must have attribute enctype=”multipart/form-data” included in form tag.
You cannot get file name from $_POST array, rather you should use $_FILES[‘fieldname’][‘name’];