|
本帖最后由 全球VPS大学 于 2020-2-14 19:41 编辑
- if($GLOBALS['config']['app']['encrypt']=='3'){
- require_once 'encryption.php';//引用加密文件
- $player_info['url'] = encryption_en::encode($player_info['url'],'123');
- $player_info['url_next'] = encryption_en::encode($player_info['url_next'],'123');
-
- }
- //其中 $player_info['url'] 是一个标签。
- / 加密方式是这个调用的 encryption_en::encode('abc','123');
- //其中123 是密钥
- 然后总是提示encryption_en' not found 错误
- //encryption.php 部分代码
- class encryption_en{
- private static $default_key = '123';
-
- public static function encode($string,$key = '', $expiry = 0){
- $ckeyLength = 4;
- $key = md5($key ? $key : self::$default_key);
- $keya = md5(substr($key, 0, 16));
- $keyb = md5(substr($key, 16, 16));
- $keyc = substr(md5(microtime()), - $ckeyLength);
复制代码
|
|