/    Sign up×
Community /Pin to ProfileBookmark

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?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@so_is_thisDec 09.2006 — For that information, you can insert the following value (in its entirety) into a single text column of your MySQL table:
[code=php]
$_SERVER["HTTP_USER_AGENT"][/code]

...or you can break down (parse) that string and insert just its component parts into separate columns..
Copy linkTweet thisAlerts:
@felgallDec 09.2006 — 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.
Copy linkTweet thisAlerts:
@so_is_thisDec 09.2006 — Of course your visitors can configure their browser to put whatever they like in that field ...[/QUOTE]
You say that like every browser supports such changes. How do you change the IE browser to say something different?
Copy linkTweet thisAlerts:
@toplisekauthorDec 10.2006 — Of course your visitors can configure their browser to put whatever they like in that field [/QUOTE]
Where is this defined as PHP server based language and it can not be changed on client side or...
Copy linkTweet thisAlerts:
@so_is_thisDec 11.2006 — 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.
Copy linkTweet thisAlerts:
@felgallDec 11.2006 — 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.
×

Success!

Help @toplisek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...