RE: [PHP] Screen Size detect??

2003-02-01 Thread Nigel Powell

On a slight side note to this, how can you pass javascript variables to 
PHP via POST?

Newbie Powell

On Saturday, February 1, 2003, at 12:21 PM, 
[EMAIL PROTECTED] wrote:

From: Sean Malloy [EMAIL PROTECTED]
Date: Sat Feb 1, 2003  6:48:26 AM Europe/London
To: Dade Register [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] Screen Size detect??


Create index.htm;

script language=JavaScript
var width  = screen.width;
var height = screen.height;
window.location = 'index.php?width=' + width + 'height=' + height;
/script

and in index.php

$width = $_GET['width'];
$height = $_GET['height'];


etc etc



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Screen Size detect??

2003-02-01 Thread Sean Malloy
index.htm
script language=JavaScript
function SubmitForm
{
   document.myform.var.value = javascriptvalue;
   document.myform.submit();
}
/script
body onLoad='SubmitForm();'
form name='myform' action='index.php' method='post'
input type='hidden' name='var' value=''
/form
/body

or something. I don't even know if that code works... I haven't tested it.
but that could be the basis for somehting


-Original Message-
From: Nigel Powell [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 2 February 2003 3:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Screen Size detect??



On a slight side note to this, how can you pass javascript variables to
PHP via POST?

Newbie Powell

On Saturday, February 1, 2003, at 12:21 PM,
[EMAIL PROTECTED] wrote:

 From: Sean Malloy [EMAIL PROTECTED]
 Date: Sat Feb 1, 2003  6:48:26 AM Europe/London
 To: Dade Register [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] Screen Size detect??


 Create index.htm;

 script language=JavaScript
 var width  = screen.width;
 var height = screen.height;
 window.location = 'index.php?width=' + width + 'height=' + height;
 /script

 and in index.php

 $width = $_GET['width'];
 $height = $_GET['height'];


 etc etc


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Screen Size detect??

2003-02-01 Thread Martin
you can create a form with hidden fields like this

 script language=JavaScript

document.screendata.height.value=screen.height;
document.screendata.width.value=screen.width;
screendata.submit();
/script

form method=post action=index.php name=screendata
input type=hidden name=height
input type=hidden name=width
/form

bye

Nigel Powell [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On a slight side note to this, how can you pass javascript variables to
 PHP via POST?

 Newbie Powell

 On Saturday, February 1, 2003, at 12:21 PM,
 [EMAIL PROTECTED] wrote:

  From: Sean Malloy [EMAIL PROTECTED]
  Date: Sat Feb 1, 2003  6:48:26 AM Europe/London
  To: Dade Register [EMAIL PROTECTED], [EMAIL PROTECTED]
  Subject: RE: [PHP] Screen Size detect??
 
 
  Create index.htm;
 
  script language=JavaScript
  var width  = screen.width;
  var height = screen.height;
  window.location = 'index.php?width=' + width + 'height=' + height;
  /script
 
  and in index.php
 
  $width = $_GET['width'];
  $height = $_GET['height'];
 
 
  etc etc




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Screen Size detect??

2003-01-31 Thread Dade Register
I'm trying to detect the screen size of any client
browser, or at least IE. Is there a php function that
can do this? If not, does anyone have any ideas on a
JS that would work too? Plz help. Thanx.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Screen Size detect??

2003-01-31 Thread Maxim Maletsky

There is no way to do that with PHP.

PHP/JavaScript rule #1:

PHP = Client Side
JS  = Server Side

Obviously, client's browser is Client Side and PHP, which is Server Side,
cannot be used for detecting Client's properties on page request (page
wasn't prepared by PHP yet to activate any JS).

With JS you can detect screen sizes by using JavaScript `screen' and
`window' objects.  Find them on developer.netscape.com.

The wildest combination of PHP with client's screen sizes would be adding
JS code into a page that sets the width/height (JS) variables as the
page starts loading to then launch an 1x1 pixel image with these two
variables passed as the URL parameters of the image tag and, the image
is actually to be a PHP script which temporarily records it. 

Comparing the sessions of the current page and image's request you would
be able to retrieve the screen size before continuing the page loads,
adjusting the HTML to fit into that very screen.

But, that is only theoretical. Technically it would mean a lot of
trouble. Firstly because you would need to suspend the page load till
when the client requested that image so your server knows the screen
width/height, to then release the rest of thepage to browser. Not all
browsers will support it either and you might end up in a lot of loops
and slow response times/timeouts.

I have once done something silly like that for a project which *really*
depended on it (a videogame). And, I wouldn't do it once again :)

Best solution? Perhaps using an absolute width for HTML tables (100%)
or a fixed (minimal) page width (775 px recommended)

P.S: Hope this email gets read archived and read from there :)

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Fri, 31 Jan 2003 20:48:19 -0800 (PST) Dade Register [EMAIL PROTECTED] wrote:

 I'm trying to detect the screen size of any client
 browser, or at least IE. Is there a php function that
 can do this? If not, does anyone have any ideas on a
 JS that would work too? Plz help. Thanx.
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Screen Size detect??

2003-01-31 Thread Maxim Maletsky

On Sat, 01 Feb 2003 18:44:19 +0100 Maxim Maletsky [EMAIL PROTECTED] wrote:

 There is no way to do that with PHP.
 
 PHP/JavaScript rule #1:
 
   PHP = Client Side
   JS  = Server Side

Geez I mean viceversa :) In Stalin's times I'd get killed for
certain mistakes :)


-- 
Maxim Maletsky
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Screen Size detect??

2003-01-31 Thread Sean Malloy
Create index.htm;

script language=JavaScript
var width  = screen.width;
var height = screen.height;
window.location = 'index.php?width=' + width + 'height=' + height;
/script

and in index.php

$width = $_GET['width'];
$height = $_GET['height'];


etc etc

-Original Message-
From: Dade Register [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 1 February 2003 3:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Screen Size detect??


I'm trying to detect the screen size of any client
browser, or at least IE. Is there a php function that
can do this? If not, does anyone have any ideas on a
JS that would work too? Plz help. Thanx.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php