当前位置:网站首页>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>
边栏推荐
- 是“凯撒密码”呀。(*‘▽‘*)*
- [sword finger offer] interview question 24 Reverse linked list
- [automated test] what you need to know about unittest
- Alipay native components (hotel time selection)
- php安全开发15用户密码修改模块
- Call C function in Lua
- Data analysis report
- php 18 首页的文章列表功能实现
- Introduction and use of ES6
- [sword finger offer] interview question 25 Merge two ordered linked lists
猜你喜欢

Real time question answering of single chip microcomputer / embedded system

Small program imitating Taobao Jiugong grid sliding effect

dumi 搭建文档型博客

Common encryption and decryption function encapsulation - AES encryption and decryption

记录一次排查问题的经过——视频通话无法接起

Mongodb compass connects to the Alibaba cloud remote server database or reports an error occurred while loading instance info: command hostinfo req

一款開源的Markdown轉富文本編輯器的實現原理剖析

Differences and relations between three-tier architecture and MVC

Hugo blog building tutorial

The could not find com scwang. smart:refresh-layout-kernel:2.0.3. Required by: project: the app cannot load the third-party package
随机推荐
Analyse du principe de mise en œuvre d'un éditeur de texte open source markdown - to - rich
【Flutter 問題系列第 67 篇】在 Flutter 中使用 Get 插件在 Dialog 彈窗中不能二次跳轉路由問題的解决方案
【剑指Offer】面试题25.合并两个有序的链表
Dumi builds a document blog
电磁兼容常用名词术语
2019 Blue Bridge Cup
出现Could not find com.scwang.smart:refresh-layout-kernel:2.0.3.Required by: project :app 无法加载第三方包情况
[sword finger offer] interview question 25 Merge two ordered linked lists
Get parameters on link
Small program input element moving up
Ultra quicksort reverse sequence pair
Common ways to traverse map sets
Collection of wrong questions in soft test -- morning questions in the first half of 2010
ET框架-22 创建ServerInfo实体及事件
Uni app dynamic add style dynamic bind background image invalid
The most detailed swing transformer mask of window attachment in history -- Shaoshuai
Answer private message @ Tiantian Wx //2022-6-12 C language 51 single chip microcomputer led analog traffic light
The WebView case of flutter
PAT 1054 The Dominant Color
1-72 convert string to decimal integer