Screen Res Question

Screen Res Question

am 23.10.2007 16:46:23 von Steve Ray

Guys

Is there a way to capture via an environment variable the users screen res

Steve

Re: Screen Res Question

am 23.10.2007 17:30:47 von zeldorblat

On Oct 23, 10:46 am, "Steve Ray" wrote:
> 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.

Re: Screen Res Question

am 23.10.2007 23:07:27 von Michael Fesser

..oO(ZeldorBlat)

>On Oct 23, 10:46 am, "Steve Ray" wrote:
>>
>> 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

Re: Screen Res Question

am 23.10.2007 23:08:00 von Charles Crume

Not in PHP (it runs on the server), but you can with Javascript.

See: http://www.pageresource.com/jscript/jscreen.htm

Charles...



"Steve Ray" wrote in message
news:ffl1hn$6s4$1@north.jnrs.ja.net...
> Guys
>
> Is there a way to capture via an environment variable the users screen res
>
> Steve
>

Re: Screen Res Question

am 23.10.2007 23:37:20 von Bucky Kaufman

"Michael Fesser" wrote in message
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.

Re: Screen Res Question

am 24.10.2007 00:45:43 von Michael Fesser

..oO(Sanders Kaufman)

>"Michael Fesser" wrote in message
>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

Re: Screen Res Question

am 24.10.2007 06:19:00 von Jeff North

On Tue, 23 Oct 2007 15:46:23 +0100, in comp.lang.php "Steve Ray"

wrote:

>| 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
-- ------------------------------------------------------------ -

Re: Screen Res Question

am 24.10.2007 19:09:29 von Bucky Kaufman

"Michael Fesser" wrote in message
news:0aush3pkvmeh0r8pbai51si1b4vdjmruej@4ax.com...
> .oO(Sanders Kaufman)
>
>>"Michael Fesser" wrote in message
>>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.)

Re: Screen Res Question

am 25.10.2007 17:12:15 von Michael Fesser

..oO(Sanders Kaufman)

>"Michael Fesser" wrote in message
>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

Re: Screen Res Question

am 25.10.2007 19:07:20 von Bucky Kaufman

"Michael Fesser" wrote in message
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.

Re: Screen Res Question

am 25.10.2007 19:37:58 von Michael Fesser

..oO(Sanders Kaufman)

>"Michael Fesser" wrote in message
>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