Questions tagged [browscap]

Browscap is a browser capabilities database that provides detailed information about a browser from its user agent.

Browscap is a browser capabilities database that provides detailed information about a browser from its user agent.

Useful Links

43 questions
53
votes
4 answers

browscap ini directive not set

I'm using the get_browser() function in an attempt to warn people that their browser doesn't support Javascript. Actually I'm using it to tell them they can use certain parts of a web application I'm building. I've decided to properly use Javascript…
Robert Hurst
  • 8,902
  • 5
  • 42
  • 66
25
votes
5 answers

How should I be setting browscap.ini file

I downloaded the browscap.ini file and then pasted it to the directory "C:\wamp\bin\php\php5.4.3\extras" and i went to php.ini file and made these changes there: [browscap] ; http://php.net/browscap browscap = extras/browscap.ini and then i…
Nicholas Wild
  • 629
  • 1
  • 6
  • 17
11
votes
3 answers

Browscap.ini throwing an error when loading PHP (command line - PHP_CLI)

I have a cronjob that summarize browser statistics. This cronjob loads data and then use the get_browser() PHP function to parse the browser information. Here's what I did: cd /etc/php5/cli/conf.d me@ubutnu:/etc/php5/cli/conf.d$ sudo wget…
Tech4Wilco
  • 6,740
  • 5
  • 46
  • 81
11
votes
3 answers

get_browser() returns FALSE

- Running PHP 5.3.8 on Linux- To start, we have solved this issue to the point where the function returns the expected values. However there are still a lot of unanswered questions I've got, and the "solution" is more of a hack-around than…
orourkek
  • 2,091
  • 15
  • 22
9
votes
2 answers

PHP: Using browscap.ini on shared host. - ini_set() failing

I'm trying to use get_browser() , unfortunately my page is on a shared host, and I have no access to php.ini. I have downloaded the latest version of browscap.ini and placed in my document root. I have then added the following:- if…
8
votes
1 answer

Browscap.ini missing

I'm new to PHP, I'm leraning on my own and I'm trying to use the get_browser() function, but I checked in my phpinfo() and it seems I don't have it, because it says "no value". Could you please help me setting up one, or downloading one I can use?…
krlozadan
  • 317
  • 2
  • 5
  • 10
5
votes
2 answers

Setting Up browscap for PHP

I have just tried enabling php_browscap.ini so that I can use the get_browser function. However, it seems to display an empty array? $user_agent = get_browser(null, true); print_r($user_agent); In my php.ini file, I have the…
Abs
  • 56,052
  • 101
  • 275
  • 409
4
votes
1 answer

How definitions for browser capabilities are updated in .NET Framework?

I want to use HttpBrowserCapabilities in order to gather statistics about the devices used to access a website. As far as I know, HttpBrowserCapabilities is based on .browser files in %SystemRoot%\Microsoft.NET\Framework\version\CONFIG\Browsers…
Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
3
votes
1 answer

Set $_SERVER['HTTP_USER_AGENT'] for get_browser()

I want to set $_SERVER['HTTP_USER_AGENT'] manually before calling get_browser() function. but it gives me an error.…
Insu Yun
  • 76
  • 4
3
votes
4 answers

How to determine the browser of the user using PHP?

How to determine the browser of the user using PHP? So that if the users browser is IE then the variable $alert="onbeforeunload" and if it is not IE, for example Firefox (else) then $alert="onload. Help is much appreciated. Thanks Also please note…
ron8
  • 243
  • 2
  • 5
  • 13
3
votes
4 answers

get_browser slowing down page load, any alternative?

I have used PHP's get_browser function for quite some time now and have never really noticed any lag on any of my websites. However, recently I noticed that one of my sites was taking a second or so more to load at the server end than it should…
Ben Carey
  • 16,540
  • 19
  • 87
  • 169
3
votes
1 answer

Apache PHP HTTP_USER_AGENT and get_browser returning incorrect values

I am developing a corporate website for my HSC Software Design and Development Major Project. I have a section of code to check if the user's browser was supported in a MySQL database and, if not, display a warning to them and log their browser…
Joshua Walsh
  • 1,915
  • 5
  • 25
  • 50
2
votes
3 answers

Improve php get_browser() performance

We are using get_browser() in PHP using php_browscap.ini but performance is horrible. We pass 100 or so user-agents into get_browser() per page and it takes over 30 seconds to render the page. We need a performant solution, without storing the…
Justin
  • 42,716
  • 77
  • 201
  • 296
2
votes
1 answer

xampp browscap.ini is present but still get_browser() giving strange values

Before saying that its a duplicate please read on, I have done my homework properly :) I have checked the other posts but nothing helped :( Here are the things that i have already taken care of: 1. Downloaded updated copy of php_browscap.ini from…
Harry
  • 1,572
  • 2
  • 17
  • 31
1
vote
4 answers

Changing PHP.ini using htaccess on a Server

I am trying to use PHP's built-in function get_browser(). I followed the instructions in this useful post, but I'm still getting the error browscap ini directive not set. I downloaded the php_browscap.ini file and moved it into the same directory…
LonelyWebCrawler
  • 2,866
  • 4
  • 37
  • 57
1
2 3