Browser Detector... - RMB Scripting
You appear not to have an account with us, Click HERE to register an account...
RMB Scripting
Navigation
  Home
  Contact
  FAQ
  Forum
  Topsites
  Members
  Affiliates
  Arcade <-- New!
  IoxHost
Downloads
  Templates
  Scripts
  Fonts
  Image Sets
  Software
  Other
 
Tutorials
  .htaccess
  Photoshop
  C/C++
  CSS
  Macromedia Flash
  MySQL
  PHP
  PHP - User System
  HTML
  Javascript
  Macintosh
  Macromedia Fireworks
  Visual Basic
  Visual C#
  Windows
  Python
  Other
 
Latest Tutorials
RMB User Commenting Sy...
Easy Navigation Integr...
Decorate Basic Icon
paragraph shortner
Convert Email address ...
Latest Comments
Badge System
Pet system
Pet system
Badge System
Report & Warn Script
Stats
Total Members: 597 [241]
Total Tutorials: 284
Newsest User: andrerds
Todays Unique Hits: 116
Users Online: 0
 
8 Guests
Poll
What do you look for in a web host?
Price
Uptime
Reviews
Customer Service
Size of Company
Main Content
Tutorial: Browser Detector... By Diablosblizz
Easy tutorial to find out if your user is using FireFox or Internet Explorer.
   
CODE:
<?php
$browser = $_SERVER['HTTP_USER_AGENT']; //gets the browser

if($browser == 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3') {
echo "Mozilla FireFox";
}

if($browser == 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2)') {
echo "Internet Explorer";
}
?>


Simple enough, you can add others if you which, but those are the two most used. I hope this comes in handy!
Difficulty: Easy
Views: 1341
Rating:
Comments
Posted on Sunday 23rd September 2007 at 08:40 PM
darklight19
This won't work if you have a tool bar installed that renames the user agent.
Post A Comment
12
Notice:
Remember to post long codes on our pastbin! - (http://rmb.pastebin.com/)
Add Comment
You must be logged in to post a comment.
Good Evening Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
$2.50 Resellers
Free Domains
Free Games
Affiliates