|
|
登录后台页面显示:
} else { return true; } } function is_robot() { return preg_match("/(spider|bot|crawl|slurp|lycos|robozilla)/i", $_SERVER['HTTP_USER_AGENT']); } function is_ip($ip) { return preg_match("/^([0-9]{1,3}\.){3}[0-9]{1,3}$/", $ip); } function is_mobile($mobile) { return preg_match("/^1[3|4|5|8]{1}[0-9]{9}$/", $mobile); } function is_md5($password) { return preg_match("/^[a-f0-9]{32}$/", $password); } function debug() { global $db, $debug_starttime; $mtime = explode(' ', microtime()); $s = number_format(($mtime[1] + $mtime[0] - $debug_starttime), 3); echo 'Processed in '.$s.' second(s), '.$db->querynum.' queries'; if(function_exists('memory_get_usage')) echo ', Memory '.round(memory_get_usage()/1024/1024, 2).' M'; } function dhttp($status, $exit = 1) { switch($status) { case '301': @header("HTTP/1.1 301 Moved Permanently"); break; case '403': @header("HTTP/1.1 403 Forbidden"); break; case '404': @header("HTTP/1.1 404 Not Found"); break; case '503': @header("HTTP/1.1 503 Service Unavailable"); break; } if($exit) exit; } function d301($url) { dhttp(301, 0); dheader($url); } ?> |
|