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
Login verification, logout login login.php
用户中心
'; echo '点击此处 注销 登录!
'; exit; } else { exit('登录失败!点击此处 返回 重试'); } //注销登录 if($_GET['action'] == "logout"){ unset($_SESSION['userid']); unset($_SESSION['username']); echo '注销登录成功!点击此处 登录'; exit; } ?>
Login monitoring my.php
'; echo '用户ID:',$userid,'
'; echo '用户名:',$username,'
'; echo '注销 登录
'; ?>
Connect to the database conn.php
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!