i'm running an apache server on my Mac Mini running Mac OS X 10.4.11, with entropy's PHP 5.2.2 installed. i've tried to use function get_browser to perform browser identification, but it doesn't seem to be working properly :-\
i've checked the php.ini file, at first the browscap.ini was apparently not loaded, as the line containing the path to the file was commented out. it pointed to extra/browscap.ini, which didn't exist anyway. now i've activated the line, downloaded the php_browscap.ini file from http://browsers.garykeith.com/downloads.asp, and stored it as /usr/local/php5/lib/extra/php_browscap.ini
my php.ini now looks like this:
Code: Select all
[browscap]
browscap = extra/php_browscap.ini
Code: Select all
<?php
echo "user-agent: " . $_SERVER[ 'HTTP_USER_AGENT' ] . "\n\n<br>";
if( ini_get( "browscap" ) ) {
echo "browscap is available<br>\n";
$browser = get_browser( null, true );
print_r( $browser );
}
else {
echo "no browscap <!-- s:-( --><img src=\"{SMILIES_PATH}/icon_sad.gif\" alt=\":-(\" title=\"Sad\" /><!-- s:-( -->\n";
}
?>
Code: Select all
user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
browscap is available
thx in advance!