Get visitor screen resolution using PHP

Get visitor screen resolution using PHP

Postby rtuszendi » 2013.06.16. 12:13

Get visitor screen resolution using PHP




Code: Select all
function client_screen()
      {
            if(!isset($_GET['screen_check']))
                {
                /* This code will be executed if screen resolution has not been detected.*/
                echo "<script language='JavaScript'>
                            <!--
                            document.location=\"$PHP_SELF?screen_check=done&Width=\"+screen.width+\"&Height=\"+screen.height;
                            //-->
                            </script>";
                }
            else
            {   
            /* This code will be executed after screen resolution is detected.*/
                if(isset($_GET['Width']) && isset($_GET['Height'])) {
            // Resolution  detected
            return $_GET['Width']." x ".$_GET['Height'];
           
                 }
                 else {
                           // Resolution not detected
                 return 'Resolution not detected';
                 
                 }
                 
            }
User avatar
rtuszendi
Adminisztrátor
 
Posts: 326
Joined: 2012.02.03. 20:26
Location: Hungary, Debrecen
Country: Hungary
city: Debrecen

Return to PHP Code Snippets

Who is online

Users browsing this forum: No registered users and 1 guest

cron


Flag Counter