<SCRIPT LANGUAGE="JavaScript1.2">
function detect() 
{
  screen.width;
}
</SCRIPT>

解决方案 »

  1.   

    这是在客户端用javascript实现的,PHP在服务器端,可以通过在javascript中设置cookie,在PHP中就可以得到这个值了。
      

  2.   

    <head>
    <SCRIPT >
      sw=screen.width;
      sh=screen.height;
    </SCRIPT> </head>  <form action="test.php" method=post>
      <input type=hidden name=sw>
      <input type=hidden name=sh>
           ... ...
      <input type=submit value="发送">
    //test.php<?
      echo "分辨率: ".$sw." x ".$sh;
    //如果用于程序
      if ($sw < 1024)
       {     ... ...     }?>
      

  3.   

    sw=screen.width
    楼上的
    你的程序好像没有把screen.width值赋给表单元素啊
    是不是该改改
      

  4.   

    <HTML><HEAD><TITLE>screen solution</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <SCRIPT language=JavaScript>
    <!-- Begin
    function getscreen() {
    if ((screen.width == 640) && (screen.height == 480)) 
      alert("现在显示器的分辨率是640*480");
    if ((screen.width == 800) && (screen.height == 600))
      alert("现在显示器的分辨率是800*600");
    if ((screen.width == 1024) && (screen.height == 768))
      alert("现在显示器的分辨率是1024*768");
    }
    // End -->
    </SCRIPT>
    </HEAD>
    <BODY>
    <input onClick=getscreen(); type=button value=查看当前分辩率>
    </BODY></HTML>
      

  5.   

    除了用cookie 有没有跟好的方法把 js 的变量赋值给 php??