Php implements automatic registration and automatic login verification code _ PHP Tutorial

Source: Internet
Author: User
Tags name database
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...

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.