当前位置:网站首页>PHP security development 13 column module of blog system
PHP security development 13 column module of blog system
2022-06-12 01:46:00 【qq_ forty-two million three hundred and seven thousand five hun】
establish cate_list.php
<?php
include_once "head.php";
include_once "../common/Page.class.php";
if ($_GET['action'] == 'del'){
$id = filterstr($_GET['id']);
$conn->query("delete from cate where id='$id'");
if($conn->affected_rows>0){
redirect(2,'cate_list.php',' Delete successful ');
}
else{
redirect(2,'cate_list.php',' Delete failed ');
}
}
?>
<!doctype html>
<html>
<!--/sidebar-->
<div class="main-wrap">
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="index.html"> home page </a><span class="crumb-step">></span><span class="crumb-name"> Work management </span></div>
</div>
<div class="result-wrap">
<form name="myform" id="myform" method="post">
<div class="result-title">
<div class="result-list">
<a href="cate_add.php"><i class="icon-font"></i> New column </a>
</div>
</div>
<div class="result-content">
<table class="result-tab" width="100%">
<tr>
<th>ID</th>
<th> Column name </th>
<th> operation </th>
</tr>
<tr>
<?php
$result = $conn->query("select * from cate");
while($row = $result->fetch_assoc()){
?>
<td><?php echo $row['id'];?></td>
<td title="<?php echo $row['class_name']; ?>"><a target="_blank" href="article_edit.php?id=<?php echo $row['id'];?>" title="<?php echo $row['class_name']; ?>"><?php echo $row['class_name']; ?></a>
</td>
<td>
<a class="link-update" href="cate_edit.php?id=<?php echo $row['id'];?>"> modify </a>
<a class="link-del" href="javascript:del(<?php echo $row['id'];?>);"> Delete </a>
</td>
</tr>
<?php }?>
</table>
</div>
</form>
</div>
</div>
<!--/main-->
</div>
<script>
function del(id){
if(false==confirm(" Are you sure to delete the record ?")) return;
location.href='?action=del&id='+id;
}
</script>
</body>
</html>
admin/cate_add.php
<?php
include_once 'init.php';
include "head.php";
header("Content-type: text/html; charset=utf-8");
$title = filterstr($_POST['title']);
//echo $cateid;
//$sql="insert into article (title,content,author,keyword,catid,c_time) value ('$title','$content','$author','$keyword',$cateid,'$c_time')";
//echo $sql;
if($_POST['sub']) {
$conn->query("insert into cate(class_name)value('$title')");
if ($conn->affected_rows > 0) {
redirect(2, 'cate_list.php', ' Add success ');
} else {
redirect(2, 'cate_add.php', ' Add failure ');
}
}
?>
<!doctype html>
<html>
<!--/sidebar-->
<div class="main-wrap">
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/"> home page </a><span class="crumb-step">></span><a class="crumb-name" href="/jscss/admin/design/"> Column management </a><span class="crumb-step">></span><span> New column </span></div>
</div>
<div class="result-wrap">
<div class="result-content">
<form action="" method="post" id="myform" name="myform" enctype="multipart/form-data">
<table class="insert-tab" width="100%">
<tbody><tr>
</tr>
<tr>
<th><i class="require-red">*</i> The column :</th>
<td>
<input class="common-text required" id="title" name="title" size="50" value="" type="text">
</td>
</tr>
<th></th>
<td>
<input class="btn btn-primary btn6 mr10" value=" Submit " name="sub" type="submit">
<input class="btn btn6" onClick="history.go(-1)" value=" return " type="button">
</td>
</tr>
</tbody></table>
</form>
</div>
</div>
</div>
<!--/main-->
</div>
</body>
</html>
cate_editor.php
<?php
include_once "head.php";
header("Content-type: text/html; charset=utf-8");
$id = filterstr($_GET['id']);
//$result = $conn->query("select * from cate where id = '$id'");
//$row =$result->fetch_assoc();
$title = filterstr($_POST['title']);
if($_POST['sub']){
//echo "update article set title = '$title',content='$content',author='$author',keyword='$keyword',c_time=$c_time,catid=$catid where id='$id'";
$conn->query("update cate set class_name = '$title' where id='$id'");
if ($conn->affected_rows > 0) {
redirect(2, 'cate_list.php', ' Edit success ');
} else {
redirect(2, 'cate_edit.php', ' Edit failed ');
}
}
//$sql="insert into article (title,content,author,keyword,catid,c_time) value ('$title','$content','$author','$keyword',$cateid,'$c_time')";
?>
<!doctype html>
<html>
<!--/sidebar-->
<div class="main-wrap">
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/"> home page </a><span class="crumb-step">></span><a class="crumb-name" href="/jscss/admin/design/"> Work management </a><span class="crumb-step">></span><span> Editing works </span></div>
</div>
<div class="result-wrap">
<div class="result-content">
<form action="" method="post" id="myform" name="myform" enctype="multipart/form-data">
<table class="insert-tab" width="100%">
<tbody><tr>
</tr>
<tr><?php
$row=$conn->query("select * from cate where id = '$id'" );
$row = $row->fetch_assoc();
?>
<th><i class="require-red">*</i> The column :</th>
<td>
<input class="common-text required" id="title" name="title" value="<?php echo $row['class_name']; ?>" size="50" type="text">
</td>
</tr>
<tr>
<th></th>
<td>
<input class="btn btn-primary btn6 mr10" value=" Submit " name ="sub" type="submit">
<input class="btn btn6" onClick="history.go(-1)" value=" return " type="button">
</td>
</tr>
</tbody></table>
</form>
</div>
</div>
</div>
<!--/main-->
</div>
</body>
</html>
边栏推荐
- How to access the traifik proxy dashboard using the rancher desktop
- 联调这夜,我把同事打了...
- 2022年金属非金属矿山(小型露天采石场)安全管理人员考试模拟100题及模拟考试
- 【科普视频】到底什么是透镜天线?
- Operation of simulated examination platform of diazotization process examination question bank in 2022
- Point cloud perception algorithm interview knowledge points (I)
- 如何让杀毒软件停止屏蔽某个网页?以GDATA为例
- Simulated 100 questions and simulated examination for safety management personnel of metal and nonmetal mines (small open pit quarries) in 2022
- 2022年重氮化工艺考试题库模拟考试平台操作
- 小程序111111
猜你喜欢

如何让杀毒软件停止屏蔽某个网页?以GDATA为例

Why do we use Google search ads?

Image retrieval based on cross modal AI model

“还是学一门技术更保险!”杭州校区小哥哥转行软件测试,喜提10K+双休!

How to access the traifik proxy dashboard using the rancher desktop

Four schemes for redis to implement message queue

kali安装empire过程中遇到的各种报错解决方案

PyGame alien invasion

Point cloud perception algorithm interview knowledge points (I)

redis集群(cluster)+哨兵模式+主从(replicas)
随机推荐
How to locate keywords to make advertising accurate.
Sogou Pinyin official website screenshot tool pycharm installation
Fatal error in launcher: unable to create process using
Simplified interpretation of accuracy and recall in AI papers
Point cloud perception algorithm interview knowledge points (I)
LeetCode Algorithm 997. Find the town judge
Prism框架初识-模块化介绍
Pytorch model loading and saving, and training based on the saved model
2022年金属非金属矿山(小型露天采石场)安全管理人员考试模拟100题及模拟考试
Wechat applet - a case of comparing the size of numbers
Simulated 100 questions and simulated examination for safety management personnel of metal and nonmetal mines (small open pit quarries) in 2022
联调这夜,我把同事打了...
初探性能优化!从2个月到4小时的性能提升!
The road of global evolution of vivo global mall -- multilingual solution
Dataset how to use dataset gracefully. After reading this article, you can fully understand the dataset in c7n/choerodon/ toothfish UI
Four schemes for redis to implement message queue
php开发09 文章模块的删除和文章分类编写
Leetcode 55 jump game
2022年重氮化工艺考试题库模拟考试平台操作
php安全开发 12博客系统的 系统模块信息的修改