ÓÉÓÚ Javascript £¨Í¨³£Çé¿öÏ£©ÊÇ¿Í»§¶Ë¼¼Êõ£¬¶ø
PHP £¨Í¨³£Çé¿öÏ£©ÊÇ·þÎñÆ÷¶Ë¼¼Êõ£¬¶øÇÒ
HTTP ÊÇÒ»ÖÖ¡°ÎÞ״̬¡±ÐÒ飬Òò´ËÁ½ÖÖÓïÑÔÖ®¼ä²»ÄÜÖ±½Ó¹²Ïí±äÁ¿¡£
µ«ÊÇ£¬ÓпÉÄÜÔÚ¶þÕßÖ®¼ä´«µÝ±äÁ¿¡£Ò»ÖÖʵÏֵķ½·¨ÊÇÓÃ
PHP Éú³É Javascript ´úÂ룬²¢ÈÃä¯ÀÀÆ÷×Ô¶¯Ë¢Ð£¬½«Ìض¨µÄ±äÁ¿´«µÝ»Ø
PHP ½Å±¾¡£ÒÔÏÂÀý×ÓÏÔʾÁËÈçºÎÕâÑù×ö©¤©¤ÈÃ
PHP ´úÂëÈ¡µÃÏÔʾÆÁÄ»µÄ¸ß¶ÈºÍ¿í¶È£¬Í¨³£Ö»ÄÜÔÚ¿Í»§¶ËÕâô×ö¡£
<?php
if (isset($_GET['width']) AND isset($_GET['height'])) {
// output the geometry variables
echo "Screen width is: ". $_GET['width'] ."<br />\n";
echo "Screen height is: ". $_GET['height'] ."<br />\n";
} else {
// pass the geometry variables
// (preserve the original query string
// -- post variables will need to handled differently)
echo "<script language='javascript'>\n";
echo " location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
. "&width=\" + screen.width + \"&height=\" + screen.height;\n";
echo "</script>\n";
exit();
}
?>