【发布时间】:2011-03-05 14:36:15
【问题描述】:
如何将浏览器的高度和宽度转换为 PHP?就像从 JavaScript 到 PHP 的数据传输一样?
我认为使用innerHeight 和InnerWidth。
(如果他的屏幕尺寸小,我只需要向用户显示小图片,如果大,则需要显示大图片,并且没有有关屏幕尺寸的数据我无法做到)
我有这样的:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/slideshow.css" type="text/css" />
<script>
document.write('script.php?screen=' + screen.width + 'x' + screen.height');
</script>
</head>
<body>
<?php $lol=$_GET['screen'];
<?php echo "SIZE : $lol" ?>
</body>
</html>
而且它不起作用。我做错了什么?
【问题讨论】:
标签: php javascript html