Re: Browser Detection another page

From: Date: Fri, 13 Feb 2004 01:11:27 +0000
Subject: Re: Browser Detection another page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-177560@lists.php.net to get a copy of this message
On Fri, Feb 13, 2004 at 11:57:59AM +1100, PETCOL wrote: > Then I need to take the user to another page. > > <? php > > if (strstr($HTTP_USER_AGENT,'Windows CE')) { > //go to the Windows CE version of the site > } else { > // go to or Stay on the large version > } > > ?> Hopefully you're aware that $HTTP_USER_AGENT is an unreliable variable, in that it is sent by the client, and can contain virtually anything. I saw a response letting you know how to do this, but I would recommend not sending people to different pages based on which browser/OS they're using. The most I would use $HTTP_USER_AGENT for is if I'm presenting a list of different OSes (say, for links to OS-specific downloads), and I want to select an intelligent default. It should be possible to use CSS/(X)HTML to present your content in a way that is accessible to whichever browser accesses your site. IMHO, browser-sniffing to serve different content is a bad idea. </$.02> -- [ joel boonstra | gospelcom.net ]

« previous php.general (#177560) next »