Tutorials

Photoshop Tutorials and Flash Tutorials




Sponsors
Offshore Software Development


User Options
New
How to Add Link
  Modify Link  
 
Login
Register
 Getting Rated
Link to Us
Feedback Us
Rss feed
RSS


Categories
 

 

Author Details
  All Tutorials by dmsproject

   1   


 PHP-browserdetecting script  By dmsproject

Rate It  | Review
PHP-browserdetecting script This tutorial explains how to identify IE4+ or NS4+ on a windows 32 bit platform (all else is "OtherBrowser") and include different html Web pages for different browser types using PHP. A browserdetecting script for PHP that decides wich files that should be included, As I started with my php-site I needed something that could identify what browser the visitor was using. Why? Because I'm using three different types of navigation styles on my site, one that's IE4+ only, one for NS4+ and one for the rest. When you are using javascript, there's a lot of different browserdetectors to use, but I had difficulties finding one for php. Finally I found one that got me started, it didn't work as I wanted so I modified it a lot. Here I'll present it and try to walk you through it. What did I need to start modifying this? Well, I started everything by making a simple javascript that I could run in different browsers, It writes out exactly what the different navigator objects contains, this way it's a lot easier to know what to test for. Here is what your current browser contains: The appname of the current browser is: Microsoft Internet Explorer The appcodename of the current browser is: Mozilla The appversion of the current browser is: 4.0 (compatible; MSIE 6.0; Windows NT 5.1) The useragent of the current browser is: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) The appminorversion of the current browser is: ;SP2;
   Hits:138    Rate:  0.0(out of 5)    Vote:0   Submit Date :2006-03-18
  Rate It   |  Error   |  Review
  Category: Home > PHP > Content Management



  
Home | Feedback | Privacy | Advertise with us
Best viewed in 800x600 resolution with Internet Explorer.
Site Developed and Hosted by EthicSolutions