obtaining client resolution
Moderator: General Moderators
-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
obtaining client resolution
Hi
I am trying to fit my page content based on the client resolution.
Is it possbile to retrieve that information in PHP? and if so how?
thanks in advance
I am trying to fit my page content based on the client resolution.
Is it possbile to retrieve that information in PHP? and if so how?
thanks in advance
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
this is not server-side...
your thinking of a javascipt
Hope this helps
your thinking of a javascipt
Code: Select all
<SCRIPT LANGUAGE="Javascript">
if (screen.width < 800 && screen.height < 600) {
document.write("Site best viewed with a 800 by 600 resolution.");
}
else {
document.write("Your current resolution is bigger than 800 by 600.");
}
</SCRIPT>-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
What can I do if I want to render content (in the server-side) based on the client resolution? For example, I if the resolution is high enough, I would like to display some content from the database. If the resolution is not high enough, don't display anything.
If I am at the client side, than it is too late and the page at already been rendered.
Isn't there a way to do it in PHP?
thanks
If I am at the client side, than it is too late and the page at already been rendered.
Isn't there a way to do it in PHP?
thanks
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Make an entry screen. Whether a login screen, or a quick redirect, have the entry screen detect their browser size.
Then, using http redirect, send them to the next page, with a variable set with the browser size.
Simple, effective, and gives PHP the knowledge of the client-side.
Ideally, if it can't detect it, it should default to low resolution.
Of course, the best idea would be to avoid locked-resolution designs at all costs. Consider people that need to increase their font sizes for accessibility, people that use palm devices, and so on..
If you design the site to be accessible, you wont need locked-resolutions. The obvious sidenote being that locked-resolutions are almost never accessible.
Then, using http redirect, send them to the next page, with a variable set with the browser size.
Simple, effective, and gives PHP the knowledge of the client-side.
Ideally, if it can't detect it, it should default to low resolution.
Of course, the best idea would be to avoid locked-resolution designs at all costs. Consider people that need to increase their font sizes for accessibility, people that use palm devices, and so on..
If you design the site to be accessible, you wont need locked-resolutions. The obvious sidenote being that locked-resolutions are almost never accessible.