PHP Implementation Login Background limit to only allow one machine online _php tutorial

Source: Internet
Author: User
Tags strcmp
# # Ob_start ();
# session_start ();
# class cc{
# Private $REFURL = "http://www.BkJia.com"; Conversion page after successful login
# private $LoginFLAG =false; Login Success Sign
# Private $loginFILE = "Loginmsg.txt"; Information file
# function Setflag ($flag) {
# $this->loginflag= $flag;
#   }
# function Check () {
# global $_post;
# if (file_exists ($this->loginfile) && (Time ()-filemtime ($this->loginfile) <60) {//user login exists and is valid
# $info =file ($this->loginfile);
# $username =trim ($info [0]); Logged in User name online
# $password =trim ($info [1]); Online password (can not be saved)
# $ip =trim ($info [2]); IP is online
# $sid =trim ($info [3]); is online port
# if (strcmp ($_session[loginuser], $username) ==0) {
# if (strcmp ($_SESSION[LOGINPW], $password) ==0) {
# if (strcmp ($_server[remote_addr], $ip) ==0) {
# if (strcmp (session_id (), $sid) ==0) {
# $this->setflag (TRUE);
# echo "

Your account can be determined to be unique!

";
# $CF =fopen ($this->loginfile, "A +");
# fputs ($CF, "a");
# fclose ($CF);
# echo " ";
#//echo "";
#}else{
# echo "does not allow an account to log in at the same time on the local network." $_server[remote_port];
# $this->loginflag=false;
#             }
#}else{
# echo "does not allow simultaneous login with account.
";
# $this->loginflag=false;
#           }
#}else{
# echo "Password error:
";
# $this->loginflag=false;
#         }
#}else{
#//Verify identity here if it is correct
# echo "An error occurred during login! User name Error
";
#       }
#}else{
# if (Isset ($_post[loginuser])) {
# $_session[loginuser]=$_post[loginuser];
# $_SESSION[LOGINPW]=$_POST[LOGINPW];
# $fp =fopen ($this->loginfile, "w");
# $msg =$_post[loginuser]. "". $_POST[LOGINPW]. "". $_SERVER[REMOTE_ADDR]. "". session_id ();
# fputs ($fp, $msg);
# fclose ($FP);
#}else{
# $outtime =time ()-filemtime ($this->loginfile)-60;
# echo "Login does not exist or you have timed out (". $outtime. ") seconds) ... ";
#       }
#     }
#   }
# function Wfrom () {
# global $_post;
# if (!file_exists ($this->loginfile) | | (Time ()-filemtime ($this->loginfile)) >60) {//Login failed
# echo << <>
#
# loginform;
#}else{
# echo "already has a user login";
#   }
#   }
# }
# $D =new CC;
# $D->check ();
# $D->wfrom ();
#?>

http://www.bkjia.com/PHPjc/486513.html www.bkjia.com true http://www.bkjia.com/PHPjc/486513.html techarticle # php # Ob_start (); # session_start (); # class cc{# private $REFURL =http://www.2cto.com;//Login successful after conversion page # private $Logi Nflag=false; Login Success Sign # private ...

  • 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.