How to achieve automatic login in seven days in php

藏色散人
Release: 2023-03-14 13:42:01
Original
2737 people have browsed it

php method to achieve seven-day automatic login: 1. Create a new show.php file to implement the login page; 2. Create a function.php file to implement encrypted cookies; 3. Set the user name and password judgment; 4. Open the session and You can automatically log in within a week.

How to achieve automatic login in seven days in php

#The operating environment of this article: Windows 7 system, PHP version 7.4, Dell G3 computer.

php How to realize automatic login within seven days?

PHP enables automatic login within a week:

##1 .Create four new files


How to achieve automatic login in seven days in php

show.php

    测试 
  
用户名 密码 自动登录
Copy after login

function.php//Encrypted cookie

Here I used the XOR encryption method, because after two XOR times, it will change back to the original value


        
Copy after login

login.php


        
Copy after login

success.php

Copy after login

Run it


How to achieve automatic login in seven days in php

Check the cookie

How to achieve automatic login in seven days in php

Close the browser and reopen it. At this time, the cookie is read.


How to achieve automatic login in seven days in php

This is just to provide an idea. , the specific login verification has yet to be considered by the readers themselves.

Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of How to achieve automatic login in seven days in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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!