Home> Common Problem> body text

Use PHP to implement the simplest login interface!

卡哇伊
Release: 2020-07-16 17:42:27
forward
4365 people have browsed it

Use PHP to implement the simplest login interface!This is the first complete and very small project on the road of learning PHP. I finally saw the hope of doing the project and specially made a record

Login interface:

html code (login.html):

用户登录
  • 7天内自动登录
Copy after login

login.php: (login processing page)

Copy after login

index.php (default home page):

'; echo "注销"; } else { // 若没有登录 echo "您还没有登录,请登录"; } ?>
Copy after login

logout.php logout page

'; echo "重新登录"; ?>
Copy after login

Successful login status:

If you check Automatically log in within 7 days, the login information will be saved in the local cookie file through Cookie and Session technology. You will be logged in automatically within 7 days.

Logout page:

Several situations of login errors have been processed:

More tutorials: "php tutorial"

The above is the detailed content of Use PHP to implement the simplest login interface!. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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!