www.webdeveloper.com
Results 1 to 7 of 7

Thread: Is possible to store in MySQL users browser?

  1. #1
    Join Date
    Sep 2005
    Posts
    1,625

    Question Is possible to store in MySQL users browser?

    I would like to store users browser type, version. Is this possible with PHP or software not only with LOG file?

  2. #2
    Join Date
    Oct 2006
    Posts
    1,297
    For that information, you can insert the following value (in its entirety) into a single text column of your MySQL table:
    PHP Code:
    $_SERVER["HTTP_USER_AGENT"
    ...or you can break down (parse) that string and insert just its component parts into separate columns..

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Of course your visitors can configure their browser to put whatever they like in that field as it is a free format user definable field. Most people leave it set to say MSIE though regardless of what browser they are really using.
    Stephen

  4. #4
    Join Date
    Oct 2006
    Posts
    1,297
    Quote Originally Posted by felgall
    Of course your visitors can configure their browser to put whatever they like in that field ...
    You say that like every browser supports such changes. How do you change the IE browser to say something different?

  5. #5
    Join Date
    Sep 2005
    Posts
    1,625
    Quote Originally Posted by felgall
    Of course your visitors can configure their browser to put whatever they like in that field
    Where is this defined as PHP server based language and it can not be changed on client side or...

  6. #6
    Join Date
    Oct 2006
    Posts
    1,297
    It hasn't yet been proven that just *any* user can change this value.
    But, in any case, the server can't know which browser it is --
    except the browser tell it.

  7. #7
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    The Opera web browser provides you with several choices as to what you want the useragent to identify itself as including (depending on the Opera version):

    Internet Explorer
    Netscape
    Mozilla
    Firefox
    Opera

    To change the useragent for Internet Explorer you need to edit the appropriate entry in the registry. Most people using IE have it still reporting their browser as IE and many people not using IE also have it set to report their browser as IE as there are many antique scripts still in use that assume that IE is way in advance of the other browsers (as it was 10 years ago) instead of way behind as it is now.

    Most computer magazines that I have seen that provide cover CDs with browser software on them have edited the useragent to include their own branding. Mostly they haven't deleted the MSIE reference although there is nothing to stop them from doing so if they wanted to. I think that they just use a program that performs the appropriate updates to the install file for them so that when the browser is installed it writes what they want into the registry where the useragent value is stored.
    Stephen

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles