English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is there some mean of detecting whether the visitor views my site using a browser on standard computer screen or on a portable SMA/GMS screen ?
A site could then feed the appropriate screen version.
Wconnect can discriminate between IE,N,O browsers. Is there a special code that could recognize the browser feeding a miniature screen, for ex. a cellular phone screen, like a Tréo or Blackberry ?
An answer to that question would be greatly appreciated.

2006-07-10 20:05:53 · 5 answers · asked by jacquesbeaugrand 1 in Computers & Internet Programming & Design

5 answers

There are two environment strings that you can examine for clues as to how the user is accessing your page. HTTP_UA_OS will return the operating system, and HTTP_USER_AGENT will return browser identification. As far as I know there is no single identifier for a cell phone, you just have to test for known ones.

2006-07-10 20:24:44 · answer #1 · answered by injanier 7 · 4 0

CSS can detect this by using media type.
For example:
The CSS file:
//properties for a handheld media only
@media handheld {
div {
margin: 2px;
}
}

//properties for a normal computer screen
@media screen {
div {
margin: 10px;
}
}

//properties for both screen and handheld
@media screen, handheld {
div {
padding: 0px;
}
}

a handheld media is a small screen device, handphones, pda, etc acts as handheld media.

See http://www.w3schools.com/css/css_mediatypes.asp for more info on usage, and more media reference.

I'm sure there is ways to do this on PHP or ASP, but the easiest is this way, because you're not likely to change the content of the site depending on the media, mostly you change the styles or layout, and presents the same content to every media, and thus PHP or ASP wouldn't be needed.

2006-07-10 20:28:29 · answer #2 · answered by Lie Ryan 6 · 0 0

i suppose you could use javascript to detect the screen resolution, depending on the res re-direct to the site with the set screen size

2006-07-10 20:44:11 · answer #3 · answered by Anonymous · 0 0

there is php and im not sure about javascript, that can detect thy operating system. if it is a cell phone, its not gona say xp, it will say something else

2006-07-10 20:08:15 · answer #4 · answered by Kristofer 4 · 0 0

u can do it with css

css can detect it!

2006-07-10 22:09:06 · answer #5 · answered by JiThin J 2 · 0 0

fedest.com, questions and answers