当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 2 Fork 1

闪电侠的右手/php网站实现文件上传管理
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
delete.php 964 Bytes
一键复制 编辑 原始数据 按行查看 历史
fansOfTech 提交于 7年前 . first commit
<?php
session_start();
//var_dump($_SESSION['username']);
if($_SESSION['username']==""){echo "<script language='javascript'>;alert('请登录账户后操作');location.href='login/login.php'</script>";}
else if($_SESSION['class']=="0"){echo "<script language='javascript'>;alert('请使用管理员身份登录');location.href='login/login.php'</script>";}
?>
<?php
include("db.php");
$id=$_GET['id'];
$sql1="select * from upload where id='{$id}'";
$mysqli_result=$mysqli->query($sql1);
//var_dump($mysqli_result);
/*通过id得到fpath字段*/
if($row=$mysqli_result->fetch_array()){
$fpath=iconv("UTF-8", "gb2312", $row['fpath']);
}
//var_dump($fpath);
unlink($fpath);
$sql2="delete from upload where id='{$id}'";
$re=$mysqli->query($sql2);
if($mysqli->affected_rows>0){
echo '<script>alert("删除成功");location.href="admin_file.php";</script>';
}else{
echo 'fail';//echo '<script>alert("删除失败");location.href="admin_file.php";</script>';
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/shaoeric/php_web_site_implementation_of_file_upload_management.git
git@gitee.com:shaoeric/php_web_site_implementation_of_file_upload_management.git
shaoeric
php_web_site_implementation_of_file_upload_management
php网站实现文件上传管理
master

搜索帮助