$local_url='http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];$user_agent = $_SERVER ['HTTP_USER_AGENT'];if (strpos...
/**
?*?蜘蛛控制
?*/
function?spiderControl()?{
????$user_agent?=?strtolower?(?$_SERVER?[‘HTTP_USER_AGENT‘]?);
????$allow_spiders?=?array?(‘Baiduspider‘,?‘Googlebot‘?);
???...
分类:
其他好文 时间:
2015-04-15 17:20:59
阅读次数:
228
function is_mobile() { $user_agent = $_SERVER[‘HTTP_USER_AGENT‘]; $mobile_agents = Array("240x320","acer","acoon","acs-","abacho","ahong","airness","alcatel","amoi","android","anywhereyougo.com","a...
分类:
移动开发 时间:
2015-04-13 23:09:34
阅读次数:
400
/** * * 根据php的$_SERVER['HTTP_USER_AGENT'] 中各种浏览器访问时所包含各个浏览器特定的字符串来判断是属于PC还是移动端 * @author discuz3x * @lastmodify 2014-04-09 * @return BO...
分类:
移动开发 时间:
2015-04-08 10:41:33
阅读次数:
2158
nginx日志设置如下log_formataccess‘$remote_addr-$remote_user[$time_local]"$request"‘‘$status$body_bytes_sent"$http_referer"‘‘"$http_user_agent""$request_body""$http_x_forwarded_for"-"$http_soapaction""$request_time"‘;$remote_addr记录的是阿里云SLB内网转发地址..
分类:
其他好文 时间:
2015-04-04 19:53:52
阅读次数:
178
//判断是否属手机function is_mobile() { $user_agent = $_SERVER['HTTP_USER_AGENT']; $mobile_agents = Array("240x320","acer","acoon","acs-","abacho","ahon...
分类:
移动开发 时间:
2015-03-12 11:19:57
阅读次数:
158
$agent = $_SERVER['HTTP_USER_AGENT'];if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini...
分类:
移动开发 时间:
2015-03-11 16:27:06
阅读次数:
233
1 caching = true; 23 } 24 $ua = strtolower($_SERVER['HTTP_USER_AGENT']); 25 26 $uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasoni...
分类:
Web程序 时间:
2015-01-05 00:29:11
阅读次数:
389
当用户使用手机等移动终端访问网站时,我们可以通过程序检测用户终端类型,如果是手机用户,则引导用户访问适配手机屏幕的移动站点。本文将介绍分别使用PHP和JAVASCRIPT代码判断用户终端类型。PHP版我们使用PHP的$_SERVER['HTTP_USER_AGENT']来获取手机用户浏览器的用户代理...
分类:
移动开发 时间:
2014-12-16 16:37:09
阅读次数:
204
server{ listen 80; server_name a.cjl.com; location / { echo $http_user_agent; } } server { ...
分类:
其他好文 时间:
2014-12-10 16:00:03
阅读次数:
190