Screen Res Question
am 23.10.2007 16:46:23 von Steve RayGuys
Is there a way to capture via an environment variable the users screen res
Steve
Guys
Is there a way to capture via an environment variable the users screen res
Steve
On Oct 23, 10:46 am, "Steve Ray"
> Guys
>
> Is there a way to capture via an environment variable the users screen res
>
> Steve
PHP runs on the server -- so the answer is no.
Try Javascript.
..oO(ZeldorBlat)
>On Oct 23, 10:46 am, "Steve Ray"
>>
>> Is there a way to capture via an environment variable the users screen res
>>
>PHP runs on the server -- so the answer is no.
>
>Try Javascript.
And then the question is - why?
Micha
Not in PHP (it runs on the server), but you can with Javascript.
See: http://www.pageresource.com/jscript/jscreen.htm
Charles...
"Steve Ray"
news:ffl1hn$6s4$1@north.jnrs.ja.net...
> Guys
>
> Is there a way to capture via an environment variable the users screen res
>
> Steve
>
"Michael Fesser"
news:jjosh35rugiikvdo1dbk46sqbt006hvv24@4ax.com...
> .oO(ZeldorBlat)
>>> Is there a way to capture via an environment variable the users screen
>>> res
>>>
>>PHP runs on the server -- so the answer is no.
>>
>>Try Javascript.
>
> And then the question is - why?
The response pre-answers your question - because PHP runs on the server.
..oO(Sanders Kaufman)
>"Michael Fesser"
>news:jjosh35rugiikvdo1dbk46sqbt006hvv24@4ax.com...
>
>> And then the question is - why?
>
>The response pre-answers your question - because PHP runs on the server.
My "Why" was meant as a response to "capture ... the users screen res".
Micha
On Tue, 23 Oct 2007 15:46:23 +0100, in comp.lang.php "Steve Ray"
>| Guys
>|
>| Is there a way to capture via an environment variable the users screen res
>|
>| Steve
PHP knows nothing about the browser so you would need to use
Javascript to query the browsers viewport dimensions.
That being said, I may have a screen with its resolution set to
2048x1536 but the browser is resized to 500x300. How are you going to
handle that situation?
Do a google on html + fluid design
-- ------------------------------------------------------------ -
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
-- ------------------------------------------------------------ -
"Michael Fesser"
news:0aush3pkvmeh0r8pbai51si1b4vdjmruej@4ax.com...
> .oO(Sanders Kaufman)
>
>>"Michael Fesser"
>>news:jjosh35rugiikvdo1dbk46sqbt006hvv24@4ax.com...
>>
>>> And then the question is - why?
>>
>>The response pre-answers your question - because PHP runs on the server.
>
> My "Why" was meant as a response to "capture ... the users screen res".
Wow, you gotta know this one.
In one old app, I checked that setting because I knew some OLD people who
use 640x480 would be on the site.
In the current one, I'm checking it to see if they're coming at me with a
PDA or Cell Phone.
(I totally gave up on just using the server user agent.)
..oO(Sanders Kaufman)
>"Michael Fesser"
>news:0aush3pkvmeh0r8pbai51si1b4vdjmruej@4ax.com...
>>
>> My "Why" was meant as a response to "capture ... the users screen res".
>
>Wow, you gotta know this one.
>In one old app, I checked that setting because I knew some OLD people who
>use 640x480 would be on the site.
What does the screen res tell you about the size of the browser window
and its viewport? Exactly nothing.
>In the current one, I'm checking it to see if they're coming at me with a
>PDA or Cell Phone.
>(I totally gave up on just using the server user agent.)
I don't do any sniffing at all. I write flexible HTML and if I want to
improve the appearance on PDAs (until now it wasn't really necessary),
I could add another stylesheet with media type 'handheld'. For older PDA
browsers I could also add a simple stylesheet switcher just in case they
don't support that media type.
There's almost always a better way than browser or screen res sniffing.
Micha
"Michael Fesser"
news:5ac1i356trbl2n8vmfkuvt5v9ks9m7uch1@4ax.com...
> .oO(Sanders Kaufman)
>>In one old app, I checked that setting because I knew some OLD people who
>>use 640x480 would be on the site.
>
> What does the screen res tell you about the size of the browser window
> and its viewport? Exactly nothing.
(You're really in tantrum mode today, aintcha?)
For one thing - it tells you that the viewable browser window maxes out at
640x480.
> I don't do any sniffing at all. I write flexible HTML and if I want to
> improve the appearance on PDAs (until now it wasn't really necessary),
Wow - HTML that looks as good on a big-screen tv as it does on a cell-phone.
You should patent that process.
..oO(Sanders Kaufman)
>"Michael Fesser"
>news:5ac1i356trbl2n8vmfkuvt5v9ks9m7uch1@4ax.com...
>> .oO(Sanders Kaufman)
>
>>>In one old app, I checked that setting because I knew some OLD people who
>>>use 640x480 would be on the site.
>>
>> What does the screen res tell you about the size of the browser window
>> and its viewport? Exactly nothing.
>
>(You're really in tantrum mode today, aintcha?)
No, just being realistic.
>For one thing - it tells you that the viewable browser window maxes out at
>640x480.
In most cases it will, but it doesn't have to. The virtual desktop is
much bigger, not to mention multi-head setups. And even with a maximized
browser on a single screen it tells you nothing about the viewport size.
There can be tool bars, side bars, there is the chrome etc.
Screen res was and is irrelevant.
>> I don't do any sniffing at all. I write flexible HTML and if I want to
>> improve the appearance on PDAs (until now it wasn't really necessary),
>
>Wow - HTML that looks as good on a big-screen tv as it does on a cell-phone.
>You should patent that process.
Not necessary, all good authors already know that. Naked HTML always
looks similar anyway, lists, headings etc. And CSS can be done in a
media-dependent way. A properly structured HTML document can look good
even on a very small screen and in a linearized way. Maybe you want to
check Opera's SSR (small screen rendering) feature to get an impression
of what a site might look like on a PDA, either as-is or with a special
handheld stylesheet.
The point is not to look the same on a PDA (which is impossible), but to
look OK and - even more important - to be accessible and usable.
Micha