RE: [PHP] Getting users monitor size
He asked about detecting monitor size, not screen resolution. I don't think any javascript will ever be able to do this. On Sun, 09 Jun 2002 20:42:58 -0400, Miva Guy wrote: >Currently, I'm developing a site that makes full use of a 1024 x 768 >display >since 90% of my users have that config. > >In the off chance they have a smaller display, I have this in the >header of >my HTML template: > > >var smallver = {SCREEN_SIZE}; >if(!smallver && screen.width < 1000) >self.location.replace("{RESIZED_SMALL}"); >else if(smallver && screen.width > 1000) >self.location.replace("{RESIZED_LARGE}"); > > >Where: >'SCREEN_SIZE' => $sessiondata['session_small'] ? 1 : 0, >'RESIZED_SMALL' => $PHP_SELF."?resize=1&".$QUERY_STRING, >'RESIZED_LARGE' => $PHP_SELF."?resize=0&".$QUERY_STRING > >What all this means is that I store a Boolean variable in a sessions >table >for 'session_small'. In the php header of each page, I simply look >at that >variable to decide how to draw the page. > >The JavaScript is necessary since only client-side scripting can >pick up >that value for you automatically. If it sees that the screen size is >set to >normal (large) and the display won't allow it, it runs the page >again with >'resize=1' in the query string to allow the change of the variable >in the >sessions table. Alternatively, if the 'session_small' variable true >and the >display will allow more, the page is reloaded with the correct value >in the >table. > >Hope this helps, >Mark > >-Original Message- >From: Tom Ray [mailto:[EMAIL PROTECTED]] >Sent: Sunday, June 09, 2002 2:39 PM >To: [EMAIL PROTECTED] >Subject: [PHP] Getting users monitor size > > >Is there a way to do this with PHP? I couldn't find it in the online >docs and the archive search is offline :( > >thanks! > > >-- >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] Getting users monitor size
Currently, I'm developing a site that makes full use of a 1024 x 768 display since 90% of my users have that config. In the off chance they have a smaller display, I have this in the header of my HTML template: var smallver = {SCREEN_SIZE}; if(!smallver && screen.width < 1000) self.location.replace("{RESIZED_SMALL}"); else if(smallver && screen.width > 1000) self.location.replace("{RESIZED_LARGE}"); Where: 'SCREEN_SIZE' => $sessiondata['session_small'] ? 1 : 0, 'RESIZED_SMALL' => $PHP_SELF."?resize=1&".$QUERY_STRING, 'RESIZED_LARGE' => $PHP_SELF."?resize=0&".$QUERY_STRING What all this means is that I store a Boolean variable in a sessions table for 'session_small'. In the php header of each page, I simply look at that variable to decide how to draw the page. The JavaScript is necessary since only client-side scripting can pick up that value for you automatically. If it sees that the screen size is set to normal (large) and the display won't allow it, it runs the page again with 'resize=1' in the query string to allow the change of the variable in the sessions table. Alternatively, if the 'session_small' variable true and the display will allow more, the page is reloaded with the correct value in the table. Hope this helps, Mark -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 09, 2002 2:39 PM To: [EMAIL PROTECTED] Subject: [PHP] Getting users monitor size Is there a way to do this with PHP? I couldn't find it in the online docs and the archive search is offline :( thanks! -- 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] Getting users monitor size
On Sun, 9 Jun 2002, Tom Ray wrote: ++>Is there a way to do this with PHP? I couldn't find it in the online ++>docs and the archive search is offline :( oh..You couldn't? echo ' What's your monitor size? '; Users monitor size is in $HTTP_GET_VARS["size"]; And this is funny but true answer to your question. -- -- pozdr Rad0s Radek Gajewski [EMAIL PROTECTED] GG:694459 ICQ:110153822 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting users monitor size
On Sun, 9 Jun 2002, Tom Ray wrote: > Is there a way to do this with PHP? I couldn't find it in the online > docs and the archive search is offline :( Use JavaScript to detect it, and then you can set a cookie or add it to a request posted to the server. In either case your PHP program can then pick up the info. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php