Re: Re: Detecting devices i.e. PDA, Mobile
| From: | Justin French | Date: | Sun, 12 Oct 2003 06:53:27 +0000 |
| Subject: | Re: Re: Detecting devices i.e. PDA, Mobile | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165880@lists.php.net to get a copy of this message | ||
On Sunday, October 12, 2003, at 12:02 PM, Manuel Vázquez Acosta wrote:
Take a look at what is printed by: var_dump($_SERVER); Maybe the HTTP_USER_AGENT can lead you to somewhere out of this problem. Manu. "Shaun" <shaun@mania.plus.com> wrote in message news:20031011120232.14638.qmail@pb1.pair.com...Manuel, Shaun, $_SERVER['HTTP_USER_AGENT'] (just like anything else from the client side) can't be trusted to either exist, or to be correct. Some user agents don't set this value, and it's quite easy for it to be faked. More to the point, there's no way you can possibly account for all possible user agents out there... perhaps only the popular ones. So, $_SERVER['HTTP_USER_AGENT'] is a good starting point or method for guessing where to send people, but it's not fail safe AT ALL. I think the fail safe way is to create pages which are standards compliant (XHTML strict) and use CSS for all styling/presentation, which means your pages will accessible via the largest possible number of viewing devices, like PDA, WAP, text-to-speech, desktop browsers, Web TV, etc. The move away from table based layouts and poorly accessible webpages is a big one, but not THAT big :) JustinHi, I have created an online system, and have created a WAP version, and am currently crreating a PDA version. What I wuold like to to do is give out the same URL instead of domain.com for normal use, domain.com/wap/ or domain.com/pda/. Is there a way of detecting what device is loading thesiteand redirect them accordingly? Thanks for your help