Home  >  Article  >  Backend Development  >  PHP program authorization verification development ideas_PHP tutorial

PHP program authorization verification development ideas_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:38:06813browse

When making a commercial program, if the client is only allowed to use one server, authorization verification is very important. The following is an idea of ​​mine. Apply the server's PHP environment configuration to the program, generate a permission string, and then write the string into the permission file code. Even if the program is moved to another server unchanged, the program cannot run. I hope everyone can discuss it more...



/**
* bkJia Chinese Forum @authorized string
*/
function authorization ($seed = ) {
$encode = $_SERVER[SERVER_SOFTWARE] . $_SERVER[SERVER_NAME] . $_SERVER[DOCUMENT_ROOT] . $_SERVER[SERVER_ADMIN] . $_SERVER[SERVER_ADDR] . PHP_VERSION . PHP_OS . __FILE__;
          return md5 ($encode);
}

$authorization_key = 2cto.com;

echo authorization($authorization_key);//Here is the generated string verification
$authorization_check = array(dd670852938815f3892d3c511cc8fceb,ddc976cc02bce5c3c22c4d7d201c0cae);//Authorization string, copy the generated character verification here

if (!in_array(authorization ($authorization_key), $authorization_check)) {

​​​​die(Sorry, your program is not authorized by bkJia!!);
}


http://www.bkjia.com/PHPjc/486509.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486509.htmlTechArticleWhen making a commercial program, if the customer can only use one server, authorization verification is very important. . The following is an idea of ​​mine, to apply the server’s PHP environment configuration to the program...
Statement:
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