我必须在我的step1页面中选择一个pdf文件,然后转到step2页面填写其他详细信息。提交表单后,所有数据都应存储到数据库中。 错误显示:Undefined index pdf_file 这是我的编码..
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label><i class="zmdi zmdi-upload"></i></label>
<input type="file" name="pdf_file" id="pdf_file" accept="application/pdf" />
</div>
Step2.php
$con = mysqli_connect("localhost","root", "","db");
$pdf = $_POST['pdf'];
if(isset($_POST['confirm'])){
//upload file
$allow=array('pdf');
$temp=explode(".", $_FILES[$_POST['pdf_file']]['name']);
$extension=end($temp);
$uploadfile=$_FILES[$_POST['pdf_file']]['name'];
$appID="A0003";
$sql=mysqli_query($con, "INSERT INTO application_table (appID, pdf) VALUES ('$appID','$uploadfile')");
if($sql){
echo "okay";
}else{
echo "failed";
}
}
我犯了什么错误?