以下 $username, $password 分别指用户名和密码,$sitekey 为站点扰码。
密码设置
提交的时候,使用 javascript 处理
t_code0.value = md5 (username.value "|" passwd.value);
passwd.value = '';
假如提交的 passwd 有值或 t_code0 为空,设置密码失败;
t_code0 的值保存到数据库的 save_pwd 字段中;
密码校验
1. 用户端申请登录
服务器生成随机码 $sid,保存到 $_SESSION[sid] 中,同时传递给用户;
表单
2. 用户输入用户名和密码,提交的时候,使用 javascript 处理
var t = md5 (username.value "|" passwd.value);
t_code.value = md5 (sid "|" t);
passwd.value = '';
3. 服务器端判定
假如 username 为空 或 passwd 非空 或 t_code 为空,返回登录页;
如没有 $_SESSION[sid],返回登录页;
[php]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment