当我选择文件并单击导入按钮时,它显示:
注意:未定义的索引:文件.........
警告:fopen():在...中文件名不能为空...
<?php
if(isset($_POST['import'])){
$file = $_FILES['file']['tmp_name'];
echo $file;
$handle = fopen($file, "r");
exit;
}
?>
<form action="" method="post">
<div>
<label>Choose Excel
File</label> <input type="file" name="file"
id="file" accept=".xls,.xlsx">
<button type="submit" id="submit" name="import"
class="btn-submit">Import</button>
</div>
</form>