解析php输入文件上载-不工作
我在文件上传、PHP和解析方面遇到了问题,尽管我还没有介绍解析部分。我有一个简单的表单,输入类型=file元素解析php输入文件上载-不工作,php,file,input,mamp,Php,File,Input,Mamp,我在文件上传、PHP和解析方面遇到了问题,尽管我还没有介绍解析部分。我有一个简单的表单,输入类型=file元素 <input type="file" class="form-control" id="inputFirstName" name="inputFirstName" /> 在您的表单标记中使用enctype=“multipart/form data”。。。。就这么简单。我以为我已经这么做了,但没有意识到这是一个打字错误。谢谢@Zebra先生。
<input type="file" class="form-control" id="inputFirstName" name="inputFirstName" />
在您的
表单
标记中使用enctype=“multipart/form data”
。。。。就这么简单。我以为我已经这么做了,但没有意识到这是一个打字错误。谢谢@Zebra先生。
<form class="form-horizontal" role="form" method="post" enctype="multipart/form">
<?php if($formPosted) : ?>
<div class="form-group">
<div class="col-md-10" id="formAlert<?php echo $type; ?> ">
<div class="alert alert-<?php echo $messageType ?>" role="alert">
<?php echo $message; ?>
</div>
</div>
</div>
<?php endif; ?>
<div class="form-group">
<label for="inputProfilePicture" class="col-md-3 control-label">Picture</label>
<div class="col-md-8">
<input type="file" class="form-control" id="inputProfilePicture" name="inputProfilePicture">
</div>
</div>
<div class="form-group">
<label for="inputFirstName" class="col-md-3 control-label">First Name *</label>
<div class="col-md-8">
<input type="hidden" id="inputType" name="inputType" value="<?php echo $type; ?>">
<input type="text" class="form-control" id="inputFirstName" name="inputFirstName" placeholder="First Name" required="required"/>
</div>
</div>
<div class="form-group">
<label for="inputLastName" class="col-md-3 control-label">Last Name *</label>
<div class="col-md-8">
<input type="text" class="form-control" id="inputLastName" name="inputLastName" placeholder="Last Name" required="required"/>
</div>
</div>
<div class="form-group">
<label for="inputEmail" class="col-md-3 control-label">Email *</label>
<div class="col-md-8">
<input type="email" class="form-control" id="inputEmail" name="inputEmail" placeholder="Email" required="required"/>
</div>
</div>
<div class="form-group">
<label for="inputPhone" class="col-md-3 control-label">Phone</label>
<div class="col-md-8">
<input type="tel" class="form-control" id="inputPhone" name="inputPhone" placeholder="XXX-XXX-XXXX" pattern='\d{3}[\-]\d{3}[\-]\d{4}'/>
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="col-md-3 control-label">Password *</label>
<div class="col-md-8">
<input type="password" class="form-control" id="inputPassword" name="inputPassword" placeholder="Password" required="required"/>
</div>
</div>
<div class="form-group">
<label for="inputUserType" class="col-md-3 control-label">User Type *</label>
<div class="col-md-8">
<select id="inputUserType" name="inputUserType" required="required">
<option disabled="disabled" selected="selected"></option>
<?php
$userTypeQuery = new ParseQuery("UserType");
$results = $userTypeQuery->find();
for($i = 0; $i < count($results); $i++) {
$role = $results[$i];
echo "<option value='" . $role->get("name") . "'>" . $role->get("name") . "</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-3 col-md-8">
<!-- <button type="submit" class="btn btn-default"></button> -->
<input type="submit" class="btn btn-default" value="Create New <?php echo ucfirst($type); ?>"/>
</div>
</div>
</form>
var_dump($_FILES);