Maison >développement back-end >tutoriel php >100分的挑战
这是一个框架,运行入口文件时,最后Base::run();
public static function run(){//base.php文件中的一个方法
self::cp();
self::init();
self::control();
}
接着俺对这三个方法展开了追踪,先说第一个
private static function cp(){ if (self::CPURL == '') return; if ($_SERVER['HTTP_HOST'] == 'localhost') return; if ($_SERVER['HTTP_HOST'] == '127.0.0.1') return; if (strpos(self::CPURL,'||') !== false){ $a = explode('||',self::CPURL); foreach ($a as $v) { $d = strtolower(stristr($_SERVER['HTTP_HOST'],$v)); if ($d == strtolower($v)){ return; }else{ continue; } } header('location: http://www.haoid.cn');exit(); }else{ $d = strtolower(stristr($_SERVER['HTTP_HOST'],self::CPURL)); if ($d != strtolower(self::CPURL)){ header('location: http://www.haoid.cn');exit(); } } }
你这断章取义的怎么能行?!
呵呵,我算看出来了,论坛里的这些天天抢分的人也就是能回答那些基础点的东西了,这个论坛废了!