A simple web page password login php code _ PHP Tutorial

Source: Internet
Author: User
A simple web page password to log on to the php code. Copy the code as follows :? Php $ password1234; here is the password $ p; if (isset ($ _ COOKIE [isview]) and $ _ COOKIE [isview] $ password) {$ isviewtrue ;} else {if (isset ($ 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"])? "The password is required for viewing. enter the password. ":" The password is incorrect. please enter it again. ";
}
} Else {
$ Isview = false;
$ P = "enter the password to view the password. contact me for the password. ";
}
}
If ($ isview) {?>
Here is what is displayed after the password is successful








Reminds you to enter your password








}?>


The http://www.bkjia.com/PHPjc/325631.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325631.htmlTechArticle code is as follows :? Php $ password = "1234"; // Here is the password $ p = ""; if (isset ($ _ COOKIE ["isview"]) and $ _ COOKIE ["isview"] = $ password) {$ isview = true;} else {if (isset ($...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.