我正在做一個表單,而我無法檢索這些文件。我無法找到表單中的錯誤。如果有人能幫助我,請請。上傳不適用於HTML和PHP的文件
<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>
這是PHP ...
<?php
// require_once 'validator.php';
$data = array(); // array to pass back data
$post = array();
foreach($_POST as $key=>$value)
{
if ($key != 'submit') {
$post[$key] = $value;
echo $key.' - ' . $value ;
echo '<br>';
}
}
我越來越除了文件中的所有領域。會是什麼呢 ?我做錯了什麼?
這就是我所得到的。
性別 - FIRST_NAME - 姓氏 - 電話 - 電子郵件 - 地址 - 城市 - 國籍 - 消息 - 高度 - 大小 - 腰 - 胸圍 - 臀部 - 眼睛 - 發 - shoes -
您將得到全局變量''在$ _POST' _FILES' $,而不是文件。 – Rikesh