CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 obtaining screen resolution using java & php

Print topic Send  topic

Author Message

Posts: 639
Posted: 02/21/2013, 8:26 AM

Javascript for obtaining screen resolution (screensize.html)

window.onload = function() {
if there is no session (session = false)
if (!session) {
// call function to get the screen size

// make ajax call to php page to set the session variable

function getScreenWidth() {
layoutWidth = screen.width;

function setSession() {
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (xmlhttp.readyState==4 && xmlhttp.status==200)
// Reload the page
}"POST","screensize.php?layoutWidth=" + layoutWidth,true);

here is the php for obtaining screen resolution (screensize.php)

$width = CCGetFromGet(“width”);
$height = CCGetFromGet(“height”);
here is the php for obtaining screen resolution (screensize.php) Javascript for obtaining screen resolution (screensize.html)
Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by  and YesSoftware, Inc.