Upload files not working in HTML & PHP -



Upload files not working in HTML & PHP -

i'm doing form, , can't retrieve files. can't find error in form. please if can help me.

<div id="formulario" class="col-sm-10 col-sm-offset-1"> <form method="post" role="form" class="form-horizontal" id="iwantform" action="iwant-process.php" enctype="multipart/form-data" > <div class="col-sm-6"> <div class="form-group"> <label for="gender" class="col-md-5 control-label">select gender: </label> <div class="col-md-7"> <select class="form-control" name="gender"> <option class="selectboxtextcolor" value="female">female</option> <option class="selectboxtextcolor" value="men">men</option></select> </div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='first_name'>first name:</label> <div class="col-md-7"><input class='form-control' type='text' name='first_name' id='first_name' required /> </div></div> <div class="form-group"> <label class='col-md-5 control-label' for='last_name'>last name:</label> <div class="col-md-7"> <input class='form-control' type='text' name='last_name' id='last_name' required /> </div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='telephone'>telephone:</label> <div class="col-md-7"><input class='form-control' type='text' name='telephone' id='telephone' required /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='email'>email:</label> <div class="col-md-7"><input class='form-control' type='text' name='email' id='email' required /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='address'>address:</label> <div class="col-md-7"><input class='form-control' type='text' name='address' id='address' required /> </div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='city'>city:</label> <div class="col-md-7"><input class='form-control' type='text' name='city' id='city' required /> </div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='nationality'>nationality:</label> <div class="col-md-7"><input class='form-control' type='text' name='nationality' id='nationality' required /> </div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='nationality'>comment:</label> <div class="col-md-7"> <textarea name="message" id="" cols="30" rows="10"></textarea> </div> </div> </div> <!-- /.col-sm-6 --> <div class="col-sm-6"> <div class="col-sm-6"> <div class="form-group"> <label class='col-md-5 control-label' for='height'>height:</label> <div class="col-md-7"> <input class='form-control' type='text' name='height' id='height' required /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='size'>size:</label> <div class="col-md-7"><input class='form-control' type='text' name='size' id='size' /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='waist'>waist:</label> <div class="col-md-7"><input class='form-control' type='text' name='waist' id='waist' /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='bust'>bust:</label> <div class="col-md-7"><input class='form-control' type='text' name='bust' id='bust' /></div> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label class='col-md-5 control-label' for='hips'>hips:</label> <div class="col-md-7"><input class='form-control' type='text' name='hips' id='hips' /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='eyes'>eyes:</label> <div class="col-md-7"><input class='form-control' type='text' name='eyes' id='eyes' /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='hair'>hair:</label> <div class="col-md-7"><input class='form-control' type='text' name='hair' id='hair' /></div> </div> <div class="form-group"> <label class='col-md-5 control-label' for='shoes'>shoes:</label> <div class="col-md-7"><input class='form-control' type='text' name='shoes' id='shoes' /></div> </div> </div> <div class="col-sm-12"> <hr> <div class="form-group file"> <label class='control-label' for="filestoupload">upload photos <small> ( maxium 5 photos )</small></label> <input name="filestoupload[]" id="filestoupload" type="file" multiple /> </div> </div> </div> <!-- /.col-sm-6 --> <hr> <input id="sendbtn" type="submit" value="send"> </form>

this php...

<?php // require_once 'validator.php'; $data = array(); // array pass info $post = array(); foreach($_post $key=>$value) { if ($key != 'submit') { $post[$key] = $value; echo $key.' - ' . $value ; echo '<br>'; } }

i'm getting fields except files. ? i'm doing wrong ?

this i'm getting.

gender - first_name - last_name - telephone - email - address - city - nationality - message - height - size - waist - bust - hips - eyes - hair - shoes -

you uploaded files & details in global variable $_files , not in $_post

php html file-upload

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -