Home > Backend Development > PHP Tutorial > A simple web password login php code_PHP tutorial

A simple web password login php code_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:17:41
Original
1156 people have browsed it

Copy code The code is as follows:

$password = "1234"; // Here is the password
$p = "";
if(isset($_COOKIE["isview"]) and $_COOKIE["isview"] == $password){
$isview = true;
}else{
if(isset($_POST["pwd"])){
if($_POST["pwd"] == $password){
setcookie("isview",$_POST["pwd" ],time()+3600*3);
$isview = true;
}else{
$p = (empty($_POST["pwd"])) ? "A password is required to view, Please enter the password. " : "The password is incorrect, please re-enter ";
}
}else{
$isview = false;
$p = "Please enter the password to view it. You can get the password. Contact me. ";
}
}
if($isview){ ?>
This is where the password will be displayed after the password is successful








Script House reminds you to enter your password









} ?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325631.htmlTechArticleCopy the code code as follows: ?php $password = "1234"; // Here is the password $p = "" ; if(isset($_COOKIE["isview"]) and $_COOKIE["isview"] == $password){ $isview = true; }else{ if(isset($...
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 Issues
Why does it still jump after returning false?
From 1970-01-01 08:00:00
0
0
0
Optimize table indexes in MySQL
From 1970-01-01 08:00:00
0
0
0
Why can't I install it?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template