做一套商业程序,如只充许客户只能用于一台服务器,授权验证就很重要了。以下是我的一个想法,把服务器的php环境配置也应用在程序里面,生成一个许可字串,然后将字串写入到许可的文件代码中。就算是将程序原本不动地移到其它服务器上,程序都不能运行了。希望大家多多讨论……
/**
* bkJia中文论坛@授权字串
*/
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);//这里是生成字符串验证
$authorization_check = array(dd670852938815f3892d3c511cc8fceb,ddc976cc02bce5c3c22c4d7d201c0cae );//授权字串,把生成的字符验证复制到这里来
if (!in_array(authorization ($authorization_key), $authorization_check)) {
die(对不起,你的程序未经过bkJia授权!!);
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1
Powerful PHP integrated development environment
