How to use PHP to verify username and password (code)

不言
Release: 2023-04-03 11:30:01
Original
2422 people have browsed it

The content shared with you in this article is about using PHP to verify user names and passwords. The content is of great reference value and I hope it can help friends in need.

Login page login.html

 用户登录

Copy after login

Login verification, logout login login.php

用户中心
'; echo '点击此处 注销 登录!
'; exit; } else { exit('登录失败!点击此处 返回 重试'); } //注销登录 if($_GET['action'] == "logout"){ unset($_SESSION['userid']); unset($_SESSION['username']); echo '注销登录成功!点击此处 登录'; exit; } ?>
Copy after login

Login monitoring my.php

'; echo '用户ID:',$userid,'
'; echo '用户名:',$username,'
'; echo '注销 登录
'; ?>
Copy after login

Connect to the database conn.php

Copy after login

Related recommendations:

How to use PHP to implement single sign-on Method analysis

Use php to implement simple background registration and login (with code)

The above is the detailed content of How to use PHP to verify username and password (code). For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!