Jump to content

Browser identification


Recommended Posts

When I use Stefan's tutorial to identify browsers using PHP


<?php $_SESSION['browser'] = $_SERVER['HTTP_USER_AGENT']; ?>


I get this using IE7:-

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)


and this using Firefox:-

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/2008120122 Firefox/3.0.5


What is the Mozilla/4.0 reference in the IE7 output and what are the Windows references in the Firefox output? General explanation please.

Link to comment
Share on other sites

IE did this to accept content from Netscape browsers so long long ago and kept it:

from wikipedia:


The earliest example of this is Internet Explorer's use of a User-Agent string beginning "Mozilla/ (compatible; MSIE ...", in order to receive content intended for Netscape Navigator, its main rival at the time of its development. This was not a reference to the open-source Mozilla browser, which was developed much later, but to the original codename for Navigator, which was also the name of the Netscape company mascot. This format of User-Agent string has since been copied by other user agents, partly because Explorer, in turn, came to dominate.

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.
Note: Your post will require moderator approval before it will be visible.

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...