Php implements automatic registration and automatic logon verification code. This article introduces an implementation code for automatic login and automatic verification in php. if you need it, please refer to it. The code is as follows: Copy the code $ urlsparse_url ($ db_bbs This article introduces an implementation code for automatic login and automatic verification in php. if you need it, refer to it.
The code is as follows: |
|
$ Urls = parse_url ($ db_bbsurl ); $ Domain = $ urls ['host']; Include_once (R_P. 'require/admvclient. php '); $ Adm_oem = new Cnzz_Adm_Oem (); // Determine whether the user password exists in the config file PwCache: getData (D_P. "data/bbscache/adm_config.php"); // user name and password configuration file If (isset ($ adm_user) & isset ($ adm_pwd )){ $ Request = array ("adm_user" => $ adm_user, "adm_pwd" => $ adm_pwd, 'cms '=> 'pw '); $ Token = $ adm_oem-> get_appkey_once ($ request ); If ($ token <0 ){ If ($ token =-1 ){ Adminmsg ('pass parameter is null or pass parameter is not number '); } Else if ($ token =-2 ){ Adminmsg ('pass parameter password error '); } } Else { $ Apikey = $ token ['adm _ key']; } } Else { $ Key = md5 ($ domain. 'kclgiq7h '); $ Request = array ('cms '=> 'pw', 'domain '=> $ domain, 'key' => $ key ); $ Token = $ adm_oem-> reg_user_once ($ request ); If ($ token <0) {// exception If ($ token =-1 ){ Adminmsg ('key error '); } Else if ($ token =-2 ){ Adminmsg ('invalid domain name length (1 ~ 64 )'); } Elseif ($ token =-3 ){ Adminmsg ('incorrect domain name input (such as Chinese characters )'); } Elseif ($ token =-4 ){ Adminmsg ('wrong domain name database insert '); } Elseif ($ token =-5 ){ Adminmsg ('IP User call page exceeds the threshold, and the threshold is tentatively set to 10 '); } } Elseif (is_array ($ token) & isset ($ token )){ $ Adm_user = $ token ['adm _ user']; $ Adm_pwd = $ token ['adm _ pwd']; $ Apikey = $ token ['adm _ key']; PwCache: setData (D_P. 'data/bbscache/adm_config.php '," "); } } |
Bytes. The code is as follows $ urls = parse_url ($ db_bbs...