TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-24-2009, 06:01 PM   #1 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default Screenresolution

Is there any way of getting the screenresolution of the person who views the website?
__________________
Tanax is offline  
Reply With Quote
Old 09-24-2009, 09:15 PM   #2 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

Javascript
Code:
width = screen.width
height = screen.height
If you wanted to track it just send them to a URL with the WxH in some GET parameters and store them :)
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
The Following User Says Thank You to ioan1k For This Useful Post:
Tanax (09-25-2009)
Old 09-24-2009, 10:06 PM   #3 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Quote:
Originally Posted by ioan1k View Post
Javascript
Code:
width = screen.width
height = screen.height
If you wanted to track it just send them to a URL with the WxH in some GET parameters and store them :)
Or use ajax to send a HTTP request to a php script that collects the data.
__________________
My Site
adamdecaf is offline  
Reply With Quote
The Following User Says Thank You to adamdecaf For This Useful Post:
Tanax (09-25-2009)
Old 09-25-2009, 10:18 AM   #4 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Thanks guys!
Is there any way of doing this with PHP(in case they have JS disabled)?
__________________
Tanax is offline  
Reply With Quote
Old 09-25-2009, 10:20 AM   #5 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
Is there any way of doing this with PHP(in case they have JS disabled)?
Not that I'm aware of, no.
Salathe is offline  
Reply With Quote
Old 09-27-2009, 11:09 AM   #6 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Damn, well okay. Most people use 960px width, so I guess I use that as a standard. And then run a check with JS to see if they got higher resolution, and then just change it to wider if they got wider. If they don't have JS it will be 960px wide, which is the usual resolution.

Thanks!
Btw, this is something for you PHP guys to develop! Mostly thinking about Karl here who can propose this to the PHP team.
__________________
Tanax is offline  
Reply With Quote
Old 09-27-2009, 11:27 AM   #7 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
Btw, this is something for you PHP guys to develop!
If you mean adding this to the PHP core, I can't see that happening. The required information is not sent by browsers to the server, so PHP will never know about it (unless you use JavaScript to send that info. to a receiving script as mentioned above).

Quote:
Originally Posted by Tanax View Post
Mostly thinking about Karl here who can propose this to the PHP team.
Anyone can make suggestions (and code contributions), you don't need to be "in" with the team to do so.
Salathe is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:55 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design