RE: [PHP] get_browser() - browscap.ini for Linux

From: Date: Thu, 11 Mar 2004 12:25:05 +0000
Subject: RE: [PHP] get_browser() - browscap.ini for Linux
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-180133@lists.php.net to get a copy of this message
On Wed, 10 Mar 2004, Shaunak Kashyap wrote: > I downloaded the file from www.GaryKeith.com and set up the php.ini entry to > point to it. Then I called get_browser() and it returned nothing. > > Once again, my configuration is as under: > > OS: Linux Red Hat Enterprise WS > PHP: 4.2.3 > Web server: Apache 1.3.29 > > Have you tried using PHP's get_browser function? If that worked for you, > could you please let me know what your system configuration is? > > Thanks, > > Shaunak The following code using get_browser() (in this case to detect Netscape version 4, or earlier) works for me. Don't know that it is an example of 'elegant' coding, but it does work. :) $browser = get_browser(); $isNS4 = false; if ($browser->browser == 'Netscape') { if ($browser->majorver <= 4) { $isNS4 = true; } } lk www.theNewAgeSite.com

« previous php.general (#180133) next »