amarrgurung Posted April 15, 2013 Share Posted April 15, 2013 Any one please help me... I have three input type file in the form and the values are passed to a function if(isset($_POST['submit'])=='submit') { $result=$obj->insertdata($_POST); } ..form <form method="post" enctype="multipart/form-data"> <input type="file" name="f_image" style="width:220px;"/> <input type="file" name="ev_image" style="width:220px;"/> <input type="file" name="ga_thumb_image" style="width:220px;"/> My question is how do I send the value of each file one by one to this function public function file_upload($a, $b, $c) { print_r($a); } from the below function public function insertdata($a) { $ev_banner=self::file_upload($_FILES['ev_image'],'ev_image','gallery/banner'); } the answer i am getting is Array ( [f_image] => Array ( [name] => [type] => [tmp_name] => [error] => 4 => 0 ) [ev_image] => Array ( [name] => 027.JPG [type] => [tmp_name] => [error] => 1 => 0 ) [ga_thumb_image] => Array ( [name] => [type] => [tmp_name] => [error] => 4 => 0 ) I only want Array ( [name] => 027.JPG [type] => [tmp_name] => [error] => 1 => 0 ) this out put Please help Quote Link to comment Share on other sites More sharing options...
Barand Posted April 15, 2013 Share Posted April 15, 2013 There is advice in the manual on handling multiple file uploads http://www.php.net/manual/en/features.file-upload.multiple.php Quote Link to comment Share on other sites More sharing options...
amarrgurung Posted April 16, 2013 Author Share Posted April 16, 2013 Thank you, I guess the given tutorial will work..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.