how to get js screenresolution passed to a sessionvariable?
| From: | Simon De Deyne | Date: | Fri, 08 Feb 2002 16:31:06 +0000 |
| Subject: | how to get js screenresolution passed to a sessionvariable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84011@lists.php.net to get a copy of this message | ||
hi,
I am trying to get the screenresolution passed from a javascript
variable to a PHP variable using sessionvariables, but I can't get it to work,
can you help me out to get some code working?
I was thinking of something like this, but I'm pretty much a newbie
at lots of things, so I'm sure this can be a piece'a cake. Thanks.
Simon
//put the form value in a sessionvariable
session_register('Resolutionx');
//use a hiddenvalue in which js writes the x-resolution
<form name="anotherName">
<input type=hidden name="Resolutionx" value="0">
//get the resolution
<script language="JavaScript"><!--
x=screen.width;
document.anotherName.Resolutionx.value = x;
//--></script>