Monthly: 一月 2014
php 判断是否是手机浏览器访问
$ua = strtolower($_SERVER[’HTTP_USER_AGENT’]);
$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i";
if(($ua == ’’ || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER[’REQUEST_URI’]),’wap’))
{
$Loaction = ’mobile/’;
if (!empty($Loaction))
{
ecs_header("Location: $Loaction
");
exit;
}
} 阅读全文...
php+js禁止浏览器右键,判断刷新和后退,屏蔽按键
<script type="text/javascript">
document.oncontextmenu=function(e){return false;}
</script>
<style><!?
body {
-moz-user-select:none;
}
?></style>
<script>
function?? document.onkeydown()?? {
if?? ((window.event.altKey)&&
((window.event.keyCode==37)||?????? //屏蔽?? Alt+?? 方向键?? ←
(window.event.keyCode==39))){???? //屏蔽?? Alt+?? 方向键?? →
alert("软件不支持你使用ALT+方向键前进或后退!");
event.returnValue=false;
}
if?? (event.keyCode==116){??????? 阅读全文...
鼠标经过时鼠标变成小手形
<head>
<title></title>
<style?type="text/css">
<!--
a?{
cursor:?help;
}
-->
</style>
</head>
------------------------------------
其中的"help"可以换成以下内容
hand?手形
crosshair?十字形
text?文本形
wait?沙漏形
move?十字箭头形
help?问号形
e-resize?右箭头形
n-resize?上箭头形
nw-resize?左上箭头形
w-resize?左箭头形
s-resize?下箭头形
se-resize?右下箭头形
sw-resize?左下箭头形 阅读全文...