programming / get_browser( ) / browscap.ini
Posted by: Kevin_K (---.fuse.net)
Date: March 20, 2008 04:55PM

Greetings All!

I'm developing a website for a small non-profit organization on my local machine under Windows XP SP2, I'm using WampServer2 as my development platform; I love it but occasionally run into server config issues with my code. This is one of those times.

I'm working on developing a bit of code to, among other things, detect a visitor's browser so that my website's features can be tailored to fit this data. When I use get_browser( ) I get this error at run-time.

Warning: get_browser() [function.get-browser]: browscap ini directive not set in C:\wamp\www\Project1\testagent.php on line 8

OK said I -- I downloaded the latest version of 'brosecap.ini' and went into php.ini to set the config directive. Here it is:

[browscap]
browscap = extra/browscap.ini

This is the default setting in php.ini. Where do I place this directory and file? I created an 'extra' folder in the 'c:\wamp\' directory and placed the browscap.ini file in it. How should I point to it? Would it be:

browscap = c:\wamp\extra\browscap.ini

or,

browscap = c:/wamp/extra/browscap.ini

(I hate the whole forward slash / backslash thing -- ahhh...)
or something else? Where and what is PHP and the server expecting here?

I've tried quite a few different settings but none of them have worked yet. Any help is greatly appreciated.

Thanks.
Kev

Options: ReplyQuote
Re: programming / get_browser( ) / browscap.ini
Posted by: yfastud (Moderator)
Date: March 20, 2008 04:58PM

There is more than 1 php.ini in wamp for different features. In order to edit the prope php.ini, access it through wamp tray icon

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: programming / get_browser( ) / browscap.ini
Posted by: Kevin_K (---.fuse.net)
Date: March 20, 2008 05:29PM

Hi -- that worked like a charm. Thanks!

And for anyone else with the same question about where and how to point to this file, my setting is:

[browscap]
browscap = c:/wamp/extra/browscap.ini

And the download address for the latest version of browscap.ini is:

[browsers.garykeith.com]

This should pop open a download dialog for 'php_browscap.ini' -- I renamed mine to 'browscap.ini' to maintain look/feel compatibility.

See-yah.
Kev

"Never Underestimate the Power of Carefully Worded Nonsense."

Options: ReplyQuote


Sorry, only registered users may post in this forum.