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
Get the date of every ...
If...Else on one line ...
Drop Calendar Function
Single VS Double
Understanding Variables
Latest Comments
Simple Comment System
Simple Comment System
Simple Comment System
Simple Comment System
Private Message System
Stats
Total Members: 585 [231]
Total Tutorials: 276
Newsest User: zaithstery
Todays Unique Hits: 71
Users Online: 0
 
9 Guests
Poll
Should we change our name?
Hmmmm, Yes!!
Maybe
Depends on what to
NO!
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: 1317
Rating:
Comments
Posted on Thursday 17th May 2007 at 08:03 PM
Jon
Doesn't work...
Posted on Thursday 17th May 2007 at 11:35 PM
Diablosblizz
Could you please say whats wrong? I tested it before I tried. It works with both Internet Explorer and Firefox - as the other browsers (Opera, and NetScape) will NOT work.

Please specify whats wrong and if there is an error.
Posted on Friday 18th May 2007 at 09:45 PM
SkillMaster
Yes it does work for me. :S what is your exact problem?
Posted on Wednesday 23rd May 2007 at 09:21 PM
Jon
Basically, nothing shows up when I go on it:

http://scription.net/browser.php
Posted on Thursday 24th May 2007 at 05:44 AM
SkillMaster
Works fine for me. what browser are you using it seems to work fine in IE and mozilla for me.
Posted on Thursday 24th May 2007 at 11:15 PM
Jon
I'm on Firefox.
Posted on Thursday 24th May 2007 at 11:32 PM
ShadowMage
it works for me also, does your host support PHP?
Posted on Thursday 24th May 2007 at 11:37 PM
Jon
Yes
Posted on Thursday 24th May 2007 at 11:40 PM
Jon
nvm fixed it, I changed the "en-US" to "en-GB"...

Thanks guys.
Posted on Thursday 24th May 2007 at 11:58 PM
ShadowMage
no prob
Post A Comment
1 2
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 Morning Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
$2.50 Resellers
Free Domains
Free Games
Affiliates