Jump to content

Screen resolution capture from visitors


hjvanes

Recommended Posts

Hello PHPers,

 

One more help I think may be wrong.  I currently have code as $_GET['width'] . "x" . $_GET['height'];.  This provides continually with 640 * 480. 

 

believe this to be incorrect as I do not think that everyones screen is set to this.  Neither is my screen resolution and is still capturing these figures.

 

Is there something wrong with the variable that should be changed so that it can pick up the visitors screen resolution.

Thank you kindly,

HJ

Link to comment
https://forums.phpfreaks.com/topic/247238-screen-resolution-capture-from-visitors/
Share on other sites

OR

You could just pass the resolution from a Javascript page using $_GET which is less attractive but easier.

<?php

if( empty($_GET['w'] ))
{
?> 
<script type="text/javascript">
window.location.href = '1002.php?w=' + screen.width + '&h=' + screen.height;
</script>
<?php
}
else
{
	echo "Your screen resolution is set at ". $_GET['w']. " X " . $_GET['h'];
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.