Ua = strtolower ($ _ SERVER ['http _ USER_AGENT ']); $ Uachar = "/(nokia | sony | ericsson | mot | samsung | sgh | lg | philips | panasonic | alcatel | lenovo | cldc | midp | mobile | wap)/I "; If ($ ua = ''| preg_match ($ uachar, $ ua ))&&! Strpos (strtolower ($ _ SERVER ['request _ URI ']), 'wap ')) { $ Loaction = 'wap /'; If (! Empty ($ Loaction )) { Ecs_header ("Location: $ Loactionn "); Exit; } } /** * The Custom header function is used to filter potential security risks. * * @ Param string content * * @ Return void **/ Function ecs_header ($ string, $ replace = true, $ http_response_code = 0) { If (strpos ($ string, '../upgrade/index. Php') = 0) { Echo '<script type = "text/javascript"> window. location. href = "'. $ string. '"; </script> '; } $ String = str_replace (array ("r", "n"), array ('',''), $ string ); If (preg_match ('/^ s * location:/is', $ string )) { @ Header ($ string. "n", $ replace ); Exit (); } If (emptyempty ($ http_response_code) | PHP_VERSION <'4. 3 ') { @ Header ($ string, $ replace ); } Else www.111cn.net { @ Header ($ string, $ replace, $ http_response_code ); } } |