Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
What features does this visitors browser support? (PHP)

Does this visitor's web site support CSS? Is this visitor a robot? Should I send out frames? There are the sorts of questions that you may want to ask in a PHP page .... and PHP supports the get_browser function which can tell you ... or which can tell, most of the time, once you have it configured.

The browscap.ini file that the function needs doe NOT ship with PHP. When you think about it, there's a certain logic to that as the browser database has to be updated far more frequently that PHP, so a separate distribution channel is sensible. Latest download from http://browsers.garykeith.com/downloads.asp. Then you need to configure it into your PHP (i.e. tell your PHP where to find the file ... and I've done that on our server by adding the following line to the end of my php.ini file:
browscap = /home/wellho/include/browscap.ini
And then stopping and restarting httpd.

And get_browser will now work. See it run at http://www.wellho.net/demo/gbs.php and see the source code of my demonstration at http://www.wellho.net/resources/ex.php4?item=h304/gbs.php.




Two more new browser type demos in PHP ... see here for a sorted list of the browsers that people used for the first 1000 hits on our site yesterday, and here for a demo that send out a graphic to a real user, but a descriptive alternative to a robot. That's a cheap and cheerful way of doing some of the things that I mention with get_browser and may be all you need. There are links to source on both of these examples.
(written 2009-04-22 23:28:15)

 
Associated topics are indexed under
H306 - PHP - Who is your visitor?
  [2380] Object Oriented programming - a practical design example - (2009-08-27)
  [2343] World Flags in your PHP pages - (2009-08-10)
  [1736] Current visitors from around the world - PHP - (2008-08-04)

H110 - PHP - HTML Web Page Data Handling
  [2107] How to tweet automatically from a blog - (2009-03-28)
  [2046] Finding variations on a surname - (2009-02-17)
  [2025] Injection Attack if register_globals in on - PHP - (2009-02-04)
  [1831] Text formating for HTML, with PHP - (2008-10-11)
  [1169] Emailing as HTML (Web Page) - PHP example - (2007-04-30)
  [1136] Buffering output - why it is done and issues raised in Tcl, Perl, Python and PHP - (2007-04-06)
  [1053] Sorting people by name in PHP - (2007-01-26)
  [1001] .pdf files - upload via PHP, store in MySQL, retrieve - (2006-12-19)
  [896] PHP - good coding practise and sticky radio buttons - (2006-10-17)
  [789] Hot answers in PHP - (2006-07-02)
  [589] Robust PHP user inputs - (2006-02-03)
  [50] Current cost in your local currency - (2004-09-16)

W508 - Web and Intranet - Which Browser?
  [1519] Flipping images on your web page - (2008-01-26)


Back to
Oracle take over Sun who had taken over MySQL
Previous and next
or
Horse's mouth home
Forward to

Some other Articles
OS Commerce install made simple
Ski bore ... train bore ... dog bore
Reaching the right people with your web site
What features does this visitors browser support? (PHP)
Oracle take over Sun who had taken over MySQL
Bigger and better this year!
Learning about Lurchers
Patterns in street names
Javascript - move cursor over image to change a different image.
Nothing beats Perl to solve a data manipulation requirement quickly
2618 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2010: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho