【发布时间】:2015-08-16 14:31:15
【问题描述】:
我正在尝试根据用户的操作将特定文件名删除到文件夹中,我收到以下警告:
警告:unlink(): http 不允许取消链接
这是具有提供到 deleteRecord.php 导航的按钮的代码
> <script> //btn delete
> $(".btn_delete").click(function(){
> var id = $(this).closest('tr').children('td:first').text();
> //alert(id);
> var x;
if (confirm("Are you sure you want delete this record?") == true) {
> //alert ("You pressed OK!");
>
> location.href='deleteRecord.php?filename='+filename;
> } else {
> //alert ("You pressed Cancel!");
> return false; }
> });
> </script>
这项工作非常好,我把它展示到变量 id 来自哪里
现在这是返回警告的 php 页面:
$filename = $_GET['filename']; //get the filename like "yo.jpg"
$path = "http://www.here I have the exact address to the folder/";
unlink($path . '/' . $filename);
这个结果我再放一遍!
******警告:unlink(): http 不允许在******中取消链接
有什么建议吗?有什么建议吗?请原谅我的英语,我正在学习!
【问题讨论】:
-
您无法取消链接 URL。您取消链接文件系统上的文件。
-
http://yoursite.com/delete.php?file=/etc/passwd清理并验证您的输入。