CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 obtaining screen resolution using java & php

Print topic Send  topic

Author Message
MichaelMcDonald

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



Javascript for obtaining screen resolution (screensize.html)

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

// make ajax call to php page to set the session variable
setSession();
}
}

function getScreenWidth() {
layoutWidth = screen.width;
}

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


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 http://support.yessoftware.com.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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