hi, I think this is useful for you:
here's a script that you can load as the first page the user accesses when entering your site.
it reads out the screen data using javascript, and once this has been done, reloads itself instantly handing over the screen data via url so it is available for php -
if you use it on your site make sure that it redirects to your first page in which the style sheet can already be modified depending on the transmitted screen data.
in this demo the script reloads itself and just displays the screen data.
<?
// get screen info
?>
<head>
<title>screen info</title>
<?
if(!isset($screen_vars))
{
?>
<script>
function getScreenInfo()
{
ah = screen.availHeight;
aw = screen.availWidth;
cd = screen.colorDepth;
h = screen.height;
pd = screen.pixelDepth;
w = screen.width;
// once the info has been read by js, redirect to this url which
// * processes the screen info data
// * displays the main page, e.g. your portal's home or menu
// * replace $PHP_SELF by that page's url
url = "<?=$PHP_SELF ?>?screen_vars=ok"
+"&ah="+ah
+"&aw="+aw
+"&cd="+cd
+"&h="+h
+"&pd="+pd
+"&w="+w;
window.location.href = url;
}
</script>
<?
}
?>
</head>
<?
if(!isset($screen_vars))
echo "<body onLoad=getScreenInfo();>\n";
else
echo "<body>";
?>
<h1>Screen info grabbing</h1>
Here's the grabbed data:<br>
<?
echo "AvailHeight = $ah<br>";
echo "AvailWidth = $aw<br>";
echo "ColorDepth = $cd<br>";
echo "Height = $h<br>";
echo "Width = $w<br>";
echo "PixelDepth = $pd<br>";
?>
</body>