Re: Browser Detection
| From: | Richard Lynch | Date: | Wed, 02 May 2001 08:03:38 +0000 |
| Subject: | Re: Browser Detection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51098@lists.php.net to get a copy of this message | ||
> Is it possible with PHP (3.0.16) to detect which browser a user has and
> then load an image based on the browser type? I've found the
get_browser()
> command in the manual, but it doesn't look like that does what I want, or
I
> could just be looking at it wrong.
>
> Has anyone tried this before? and if so, could you provide some
assistance.
get_browser() only works in conjunction with a nice big fat browscap.ini
file you need to snarf from somewhere.
Probably easier to look at $HTTP_USER_AGENT variable and ereg_match() to
determine what browser it is -- Depending on just how fine-tuned you need to
check.
Check the output from <?php phpinfo();?> using a couple browsers.
--
WARNING richard@zend.com address is not working -- Use ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm