Home > php教程 > php手册 > PHP 程序授权验证开发思路

PHP 程序授权验证开发思路

WBOY
Release: 2016-06-13 12:23:01
Original
1241 people have browsed it

以下是我的一个想法,把服务器的php环境配置也应用在程序里面,生成一个许可字串,然后将字串写入到许可的文件代码中。就算是将程序原本不动地移到其它服务器上,程序都不能运行了。希望大家多多讨论……

复制代码 代码如下:


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 = 'jb51.net';
echo authorization($authorization_key);//这里是生成字符串验证
$authorization_check = array('dd670852938815f3892d3c511cc8fceb','ddc976cc02bce5c3c22c4d7d201c0cae' );//授权字串,把生成的字符验证复制到这里来
if (!in_array(authorization ($authorization_key), $authorization_check)) {
die('对不起,你的程序未经过脚本之家授权!!');
}

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template