delete.php : 代码如下: require('common.php'); // 查询出留言信息 $q = $query->query('select * from gb_content where id='.intval($_GET['id'])); $rs = $query->fetch_array($q); $error = array(); if ($rs['user_id']!=intval($_SESSION['user_id'])) {// 判断user_id是否相同 $error = '该信息你不能删除,只能删除自己发布的'; } if (!$error) { $query->query('delete from gb_content where id='.intval($_GET['id']));//删除语句 if ($rs['user_file']) {//删除附件 @unlink('uploads/'.$rs['user_file']); } echo 1;//表示成功 } else { echo $error; } ?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn