如何用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(唠叨) 这方法不错 php 文件 目录 php能做成这种服务端吗?如果可以,有C/C++基础自学大概要多久才行? 求MYSQL优化方案 php 生成html代码的问题 请教tag关键字的表结构设计方法 一个PHP传递参数的问题 解密MD5 在PHP中能直接读取DBF文件吗? 怎样取出下面这个字符串中的两个文件名?用正则吧? about "php.ini", about "php.ini" 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"];
?>
以下是其他内容
这方法不错