当前位置:网站首页>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>
边栏推荐
- 【剑指Offer】面试题24.反转链表
- Summary of webdriver API for web automated testing
- UE4 learning notes - functions of terrain tool
- Koa file upload and download
- [flutter problem Series Chapter 67] the Solution to the problem of Routing cannot be jumped again in in dialog popup Using get plug - in in flutter
- 一致性哈希的简单认识
- 第007天:go语言字符串
- Redis主从复制、哨兵模式、集群
- 10 minutes to thoroughly understand how to configure sub domain names to deploy multiple projects
- Billions of data to determine whether the element exists
猜你喜欢

knife4j aggregation 2.0.9支持路由文档自动刷新

The most detailed swing transformer mask of window attachment in history -- Shaoshuai

dumi 搭建文档型博客

第007天:go语言字符串

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

【Flutter 问题系列第 67 篇】在 Flutter 中使用 Get 插件在 Dialog 弹窗中不能二次跳转路由问题的解决方案

Small program input element moving up

Manage PC startup items

Express framework knowledge - Art template template, cookie, session

Understand the pseudo static configuration to solve the 404 problem of refreshing the page of the deployment project
随机推荐
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
JSTL -- JSP standard tag library
2022 ICML | Pocket2Mol: Efficient Molecular Sampling Based on 3D Protein Pockets
El expression
Analyse du principe de mise en œuvre d'un éditeur de texte open source markdown - to - rich
Reread the classic: end to end object detection with transformers
Filter and listener
Li Kou brush question 647 Palindrome substring
2022 ICLR | CONTRASTIVE LEARNING OF IMAGE- AND STRUCTURE BASED REPRESENTATIONS IN DRUG DISCOVERY
建模杂谈系列143 数据处理、分析与决策系统开发的梳理
十億數據量 判斷元素是否存在
【Flutter 问题系列第 67 篇】在 Flutter 中使用 Get 插件在 Dialog 弹窗中不能二次跳转路由问题的解决方案
Lenovo notebook computer uses the insert key. When the mouse becomes a small square, how to solve it
记录一次排查问题的经过——视频通话无法接起
[notes] summarize common horizontal and vertical centering methods
php开发14 友情链接模块的编写
【Flutter 問題系列第 67 篇】在 Flutter 中使用 Get 插件在 Dialog 彈窗中不能二次跳轉路由問題的解决方案
Application of dagger2 learning module (II)
The WebView case of flutter
ET框架-22 创建ServerInfo实体及事件