I have code (Javascript) if PHP is not detected.
1. How to do correct validated code, specially in echo?
2. Is possible to store into variable prepared for PHP MYSQL when I detect Javascript way my resolution?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
location.replace('http://www.mydomain.com/index.php?w=' + screen.width + '&h=' + screen.height );
</script>
<?PHP
$_SESSION['width'] = $_GET['w']; // store session data
$_SESSION['height'] = $_GET['h']; // store session data
if ($_SESSION['width']!=null){
echo ' function ShowScreenResolution(){
var w = screen.width;
var h = screen.height;
alert( "Your screen resolution is " + w + 'x' + h)}';
}
?>
</body>
</html>