Jump to content
MakeWebGames

Storing And Reading OS/Browser Information


Recommended Posts

Posted

Hey,

[*]Firstly, what would be the best way to store OS/browser information in my MySQL database?

[*]Secondly, what would be the best way to display the the answer to question one?

 

Posted

Re: Storing And Reading OS/Browser Information

I was looking at that earlier..

But then I was thinking, staff who are not coders/website developers might not understand it. So is there an easy way to select what I want from $_SERVER['HTTP_USER_AGENT']?

Posted

Re: Storing And Reading OS/Browser Information

Yes.

I was reading it for a while to think about how I could do it.

I also read a few of the user comments and they didn't help very well.

Posted

Re: Storing And Reading OS/Browser Information

Well if you use their example there, you get an array of data to work with. If you don't know how to work with arrays, you're going to need to study up on PHP 101.

Posted

Re: Storing And Reading OS/Browser Information

Warning - while you were typing a new reply has been posted. You may wish to review your post.

Actually... I think I have a way.. :-) It uses an array but not get_browser()

Posted

Re: Storing And Reading OS/Browser Information

Well so far without using get_browser() because of php.ini settings..

I get a decent working Browser Detection: Firefox 3.0.10..

But the OS Detection gives a faint idea... like Windows

Posted

Re: Storing And Reading OS/Browser Information

Try something like this

 

$info = get_browser();
echo 'Browser: '. $info['browser'] .' V'. $info['version'].'
'.
'Platform: '.$info['platform'];

 

To check the function return data you could do something like

print_r(get_browser());
Posted

Re: Storing And Reading OS/Browser Information

 

Well so far without using get_browser() because of php.ini settings..

To use this function, you'll need a browscap config file.

You can download one here: http://browsers.garykeith.com/stream.as ... rowsCapINI

Upload it, then open your php.ini and make sure the path to php_browscap.ini is correct.

E.g: browscap = "php_browscap.ini"

To test it just try out:

$info = get_browser(NULL, TRUE);
print_r($info);

 

http://isomerizer.com/index.php?x=browser

Posted

Re: Storing And Reading OS/Browser Information

Iso.. I have done what you said but yet... No success...

My lines in php.ini:

linesr.png

 

The files in the same directory:

filesy.png

 

Yet it still errors out (Despite stopping all services (PHP, Apache, ect.))

errorvwm.png

Posted

Re: Storing And Reading OS/Browser Information

I've replaced the link and tryed the file again again.. With no success.

I now currently get no error.. But no information comes up.. :|

Posted

Re: Storing And Reading OS/Browser Information

 

I've replaced the link and tryed the file again again.. With no success.

I now currently get no error.. But no information comes up.. :|

I got this at first, at least you know it can locate the browscap.

You may need to find another browscap config file, however that one worked fine for me. :?

Posted

Re: Storing And Reading OS/Browser Information

Well due to the edit of php.ini, ect. I found a function to do the Job how I need it. :-P

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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