当前位置:网站首页>php安全开发15用户密码修改模块
php安全开发15用户密码修改模块
2022-06-13 04:20:00 【qq_42307546】
创建users_editor.php
<?php
include_once "head.php";
header("Content-type: text/html; charset=utf-8");
$id = filterstr($_GET['id']);
$result = $conn->query("select * from article where id = '$id'");
$row =$result->fetch_assoc();
$password = md5(filterstr($_POST['password']));
if($_POST['sub']){
echo "update users set password = '$password' where username= '$_SESSION[username]' ";
//echo "update article set title = '$title',content='$content',author='$author',keyword='$keyword',c_time=$c_time,catid=$catid where id='$id'";
$conn->query("update users set password = '$password' where username= '$_SESSION[username] '");
if ($conn->affected_rows > 0) {
redirect(2, 'main.php', '编辑成功');
} else {
redirect(2, 'users_editor.php', '编辑失败');
}
}
//$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/">首页</a><span class="crumb-step">></span><a class="crumb-name" href="/jscss/admin/design/">作品管理</a><span class="crumb-step">></span><span>编辑作品</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>
<th><i class="require-red">*</i>密码:</th>
<td>
<input class="common-text required" id="password" name="password" value="" size="50" type="password">
</td>
<tr>
<th></th>
<td>
<input class="btn btn-primary btn6 mr10" value="提交" name ="sub" type="submit">
<input class="btn btn6" onClick="history.go(-1)" value="返回" type="button">
</td>
</tr>
</tbody></table>
</form>
</div>
</div>
</div>
<!--/main-->
</div>
</body>
</html>
head.php
<?php
include_once "init.php";
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="css/common.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
</head>
<body>
<div class="topbar-wrap white">
<div class="topbar-inner clearfix">
<div class="topbar-logo-wrap clearfix">
<h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1>
<ul class="navbar-list clearfix">
<li><a class="on" href="main.php">首页</a></li>
<li><a href="#" target="_blank">网站首页</a></li>
</ul>
</div>
<div class="top-info-wrap">
<ul class="top-info-list clearfix">
<li><a href="#">管理员</a></li>
<li><a href="users_editor.php">修改密码</a></li>
<li><a href="#">退出</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="sidebar-wrap">
<div class="sidebar-title">
<h1>菜单</h1>
</div>
<div class="sidebar-content">
<ul class="sidebar-list">
<li>
<a href="#"><i class="icon-font"></i>常用操作</a>
<ul class="sub-menu">
<li><a href="article_list.php"><i class="icon-font"></i>博文管理</a></li>
<li><a href="cate_list.php"><i class="icon-font"></i>分类管理</a></li>
<li><a href="flink_list.php"><i class="icon-font"></i>友情链接</a></li>
</ul>
</li>
<li>
<a href="system.php"><i class="icon-font"></i>系统管理</a>
<ul class="sub-menu">
</ul>
</li>
</ul>
</div>
</div>
边栏推荐
- Call C function in Lua
- Tree array explanation
- Uni app Ali font icon does not display
- SQL 进阶挑战(1 - 5)
- SCM: introduction and operation of EEPROM
- Reread the classic: end to end object detection with transformers
- Modeling discussion series 143 data processing, analysis and decision system development
- Single chip microcomputer: basic concepts of a/d and d/a
- Unity shader learning 004 shader debugging platform difference third-party debugging tools
- VGA display based on de2-115 platform
猜你喜欢

10 minutes to thoroughly understand how to configure sub domain names to deploy multiple projects

R: Airline customer value analysis practice

小程序基础入门(黑马学习笔记)

Call C function in Lua

第007天:go语言字符串

5g China Unicom ap:b SMS ASCII transcoding requirements

【自动化测试】关于unittest你需要知道的事

Real time question answering of single chip microcomputer / embedded system

Day45. data analysis practice (1): supermarket operation data analysis

Understand the pseudo static configuration to solve the 404 problem of refreshing the page of the deployment project
随机推荐
[sword finger offer] interview question 24 Reverse linked list
小程序基础入门(黑马学习笔记)
Single chip microcomputer: main index of a/d (analog-to-digital conversion)
Dumi builds a document blog
Sword finger offer 11 Minimum number of rotation array - binary lookup
Hugo blog building tutorial
环评图件制作-数据处理+图件制作
Forgotten fleeting years
Ladder race
Redis
出现Could not find com.scwang.smart:refresh-layout-kernel:2.0.3.Required by: project :app 无法加载第三方包情况
Mongodb compass connects to the Alibaba cloud remote server database or reports an error occurred while loading instance info: command hostinfo req
PAT 1054 The Dominant Color
MCU: EEPROM multi byte read / write operation sequence
十億數據量 判斷元素是否存在
Common ways to traverse map sets
建模雜談系列143 數據處理、分析與决策系統開發的梳理
MVP framework for personal summary
Principle, composition and functions of sensors of Dajiang UAV flight control system
EMC整改纲要