Posted by v_verno on 12/28/06 06:45
On Thu, 28 Dec 2006 02:45:32 -0000, "toffee" <toffee@toffee.com>
wrote:
>just a quick question - is it possible to use php to find out the current
>screen resolution ?
don't think so because php is server side and you need something on
the client.
>if not maybe somehow make js talk to php ?
this can be done. The following creates a variable R2Siz in the form
FormL that contains the size of the frame R2. Maybe this is not
exactly what you need but it is a good start. Note : not sure that it
works with all the browser because when i write something i need to be
only IE compatible.
regards
function SetPLeft()
{
document.FormL.R2Siz.value = FrameSize();
document.FormL.submit();
}
function FrameSize()
{
if (document.all)
{
screenW = parent.R2.document.body.offsetWidth;
screenH = parent.R2.document.body.offsetHeight;
}
else
{
screenW = parent.R2.innerWidth;
screenH = parent.R2.innerHeight;
}
return (screenW + 'x' + screenH);
}
[Back to original message]
|