当前位置:网站首页>PHP security development 15 user password modification module
PHP security development 15 user password modification module
2022-06-13 04:31:00 【qq_ forty-two million three hundred and seven thousand five hun】
establish 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', ' Edit success ');
} else {
redirect(2, 'users_editor.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>
<th><i class="require-red">*</i> password :</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=" 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>
head.php
<?php
include_once "init.php";
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title> Background management </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"> Background management </a></h1>
<ul class="navbar-list clearfix">
<li><a class="on" href="main.php"> home page </a></li>
<li><a href="#" target="_blank"> homepage </a></li>
</ul>
</div>
<div class="top-info-wrap">
<ul class="top-info-list clearfix">
<li><a href="#"> Administrators </a></li>
<li><a href="users_editor.php"> Change Password </a></li>
<li><a href="#"> sign out </a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="sidebar-wrap">
<div class="sidebar-title">
<h1> menu </h1>
</div>
<div class="sidebar-content">
<ul class="sidebar-list">
<li>
<a href="#"><i class="icon-font"></i> Common operations </a>
<ul class="sub-menu">
<li><a href="article_list.php"><i class="icon-font"></i> Blog management </a></li>
<li><a href="cate_list.php"><i class="icon-font"></i> Classification management </a></li>
<li><a href="flink_list.php"><i class="icon-font"></i> link </a></li>
</ul>
</li>
<li>
<a href="system.php"><i class="icon-font"></i> System management </a>
<ul class="sub-menu">
</ul>
</li>
</ul>
</div>
</div>
边栏推荐
- Message scrolling JS implementation
- php开发14 友情链接模块的编写
- Configuration and practice of shardingsphere JDBC sub database separation of read and write
- Principle, composition and functions of sensors of Dajiang UAV flight control system
- Express framework knowledge - Art template template, cookie, session
- Introduction and use of ES6
- Principle and control program of single chip microcomputer serial port communication
- Notes on uni app
- Forgotten fleeting years
- 120. 三角形最小路径和-动态规划
猜你喜欢
Express scaffold creation
Tree array explanation
R: Airline customer value analysis practice
EIA map making - data processing + map making
2019 Blue Bridge Cup
VGA display based on de2-115 platform
Redis主从复制、哨兵模式、集群
Li Kou brush question 647 Palindrome substring
Et framework -22 creating serverinfo entities and events
[chapter 67 of the flutter problem series] the solution to the problem that the get plug-in cannot jump to the route twice in the dialog pop-up window in flutter
随机推荐
MySQL索引
Sword finger offer II 022 Entry node of a link in a linked list
[kubernetes series] pod chapter actual operation
String full summary
php开发博客系统的首页头部功能实现
JSTL -- JSP standard tag library
Webpack system learning (VIII) how contenthash can prevent browsers from using cache files
Li Kou brush question 338 Bit count
The could not find com scwang. smart:refresh-layout-kernel:2.0.3. Required by: project: the app cannot load the third-party package
Introduction and use of ES6
php安全开发15用户密码修改模块
Et framework -22 creating serverinfo entities and events
Filter and listener
Message scrolling JS implementation
Forgotten fleeting years
Use the visual studio code terminal to execute the command, and the prompt "because running scripts is prohibited on this system" will give an error
重读经典:《End-to-End Object Detection with Transformers》
Common encryption and decryption function encapsulation - AES encryption and decryption
Lenovo notebook computer uses the insert key. When the mouse becomes a small square, how to solve it
Redis