Forum Moderators: coopster

Message Too Old, No Replies

Sceen Dimensions Detecting

screen dimensions

         

brendan3eb

11:59 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



Does anyone know if there is a way to detect someone's screen dimensions using php or any other language (javascript, perl etc.)? I use div's to make my layout as it's easier to add more detail so I was hoping I could do something like this:
<?
if($browser == 1047678)
{
header("Location: www.mysite.com/1047678");
}
elseif ..........
?>

Timotheos

4:22 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP can't do it. You'd have to use javascript. I found this handy script you could modify for your purpose.


<HTML>
<HEAD>
<TITLE>Detecting Screen Resolution</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function detect()
{
url = "resolution.php?width="+screen.width+"&height="+screen.height;
document.location = url;
}
// -->
</script>
</HEAD>
<BODY OnLoad="detect()">
Please select your screen resolution<br>
<a href='resolution.php?width=640&height=480'>640x480</a><br>
<a href='resolution.php?width=800&height=600'>800x600</a><br>
<a href='resolution.php?width=1024&height=786'>1024x768</a><br>
</BODY>
</HTML>

Timotheos

4:26 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some other threads here for ideas...

[webmasterworld.com...]
[webmasterworld.com...]