Jump to content

Using Get_Browser


Recommended Posts


I want to collect information on browser and OS from page viewers.

It seems the way to do this is to use the "get_browser" function in php.

However, to get the full array of data it appears that the php.ini file has to edited to point to a browscap.ini file.


I've successfully done this on my development setup using a local MAMP installation.


My production version will be on a Wordpress site hosted on TC.


My Question


If I use the "get_browser" function in a php script for the production version will the array attribute work because the php.ini file points to the browscap file? Alternatively can the php.ini file be edited?


As you can probably tell from my questions I'm a neophyte on this subject and would appreciate some guidance.



Link to comment
Share on other sites

You can create custom php.ini in your account and add this capability.


To configure a site wide php.ini, create it in the root directory(/home/user/) and add the following line to .htaccess:


suPHP_ConfigPath /home/user


Once you have placed the php.ini as above,you can now configure browscap setting in php.ini and you can point it to the browscap.ini file on your account.


Note : be sure to change "user" with correct cPanel user name.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...