Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两行代码:
$path = $_GET['path']; rmdir(realpath($path));
他们所做的应该很明显。无论如何,每次运行时,浏览器中都会显示“路径不是目录”文本 - 但检查文件系统表明该目录实际上已被删除。
我在 Windows 上使用 WAMP。
我猜它与路径的格式有关。目前,路径类似于 C:\ilmiont_server\blog。
任何建议表示赞赏,Ilmiont
尝试在路径中添加最后一个斜杠..或类似的东西:
rmdir( realpath($path) . DIRECTORY_SEPARATOR );