如何用php判断对方机器的分辨率,如果不是800*600的给出相应提示后,自动转入指定的一页??急! 推荐使用javascript来实现你要的结果。<script>if (window.width!=800){ alert('分辨率不是800*600'); location.href='index.php';}</script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵呵,笔误。抱歉。<script>if (screen.availwidth!=800){ alert('分辨率不是800*600'); location.href='index.php';}</script> 这个问题跟 PHP没关系。php 是服务器端处理的。用JS 处理客户端事务:if(window.screen.width!=800){ //作点什么吧 location.href="abc.php";} 直接用screen.width,screen.height就可以取到当前的分辨率的。 同感,可是如果我要用PHP来作数据记录呢?要知道JS的值是没办法传给PHP的吧 将js获得的结果传回php,这是我在www.dev-club.com的发贴<?phpif(!$_GET["screenX"]) {echo '<script>location = location.href+"?screenX="+screen.width+"&screenY="+screen.height;</script>';exit;}$screenX = $_GET["screenX"];$screenY = $_GET["screenY"];?>以下是其他内容 : xuzuning(唠叨) 这方法不错 smarty section用法 字符串变数组问题 shell编程主要是些什么啊?? jquery 与script的问题? 如何查询相同字段不同内容 请问哪有Perl兼容正则表达式及其相关函数介绍的文章 复选框递交的参数只能接受到最后一个值,怎么办? 新手提问:类class.overlib的用法?怎么在INIT()里设置?(在线等待) 一个关于mysql的问题! php数据查询问题 SESSION 与 数据库 问题? 为什么会这样。我require and include 一个文件时要加 "./ " 这是为什么呢?
<script>
if (screen.availwidth!=800){
alert('分辨率不是800*600');
location.href='index.php';
}
</script>
location.href="abc.php";
}
screen.width,screen.height就可以取到当前的分辨率的。
<?php
if(!$_GET["screenX"]) {
echo '
<script>
location = location.href+"?screenX="+screen.width+"&screenY="+screen.height;
</script>
';
exit;
}
$screenX = $_GET["screenX"];
$screenY = $_GET["screenY"];
?>
以下是其他内容
这方法不错