<?php $file = "ueditor\php\upload\image\*\*.png"; foreach (glob("$file") as $filename) { echo "<img src=\"".$filename."\"> "; echo "<form name=‘input‘ action=‘‘ method=‘post‘>"; //echo "目标文件夹路径:<input type=‘text‘ name=‘dir‘ value=‘$file‘/>"; //出错的原因在于$file,而是$filename echo "<input type=‘text‘ name=‘dir‘ value=‘$filename‘>"; //type=‘submit‘的话不会post出值的。。。 echo "<input type=‘submit‘ value=‘删除‘ />"; echo "</form>"; } ?> <?php error_reporting(0); $yourpost=$_POST[‘dir‘]; echo $yourpost; ?> <?php $file = $_POST[‘dir‘]; unlink($file) ?>
时间: 2024-10-18 13:44:29