SandySynaptik Posted October 30, 2011 Share Posted October 30, 2011 I want to have the browser's version in a variable and show it somewhere on the page. Every browser have different version pattern I think. How can I do so? Link to comment Share on other sites More sharing options...
Ingolme Posted October 30, 2011 Share Posted October 30, 2011 Is there a particular reason why you need the version? A lot of people change their user agent string, so there's no real way to tell what browser version they're using, or even what browser they're using. Link to comment Share on other sites More sharing options...
SandySynaptik Posted October 30, 2011 Author Share Posted October 30, 2011 I am trying to make my own "What's Your IP Address" page. There is nothing technical. So, how can I? Link to comment Share on other sites More sharing options...
Ingolme Posted October 30, 2011 Share Posted October 30, 2011 You don't need to know what browser they're using to show their IP address. Like I said, there's no real way to find out. You can look at some user agent strings and try to find a regular expression that will get the version from it. Link to comment Share on other sites More sharing options...
SandySynaptik Posted October 30, 2011 Author Share Posted October 30, 2011 I know I know that I don't need to know about their browser to show their IP address. Showing IP address is just a part of that. Till now I have extended that page to show. User's IP address User's Browser User's Screen Resolution and user's User Agent I want to add more details as possible. Link to comment Share on other sites More sharing options...
SandySynaptik Posted October 30, 2011 Author Share Posted October 30, 2011 any javascript method? Link to comment Share on other sites More sharing options...
Ingolme Posted October 30, 2011 Share Posted October 30, 2011 Javascript has the Navigator object. But that's also unreliable. Link to comment Share on other sites More sharing options...
Don E Posted October 30, 2011 Share Posted October 30, 2011 Fox, what about PHP's $_SERVER['HTTP_USER_AGENT'] ? Is that a reliable way to find out users browser info? Link to comment Share on other sites More sharing options...
Ingolme Posted October 30, 2011 Share Posted October 30, 2011 Is there a particular reason why you need the version? A lot of people change their user agent string, so there's no real way to tell what browser version they're using, or even what browser they're using.Though really I meant to say that people can change their user agent string, not that it's a common thing to do. I did say you could extract browser information from the user agent string:You don't need to know what browser they're using to show their IP address. Like I said, there's no real way to find out. You can look at some user agent strings and try to find a regular expression that will get the version from it.Different user agent strings will probably need different expressions to retrieve the version. Link to comment Share on other sites More sharing options...
birbal Posted October 31, 2011 Share Posted October 31, 2011 check this http://au2.php.net/m...get-browser.php $_SERVER['HTTP_USER_AGENT'] itself is unrilable. if you check the header of any request you will see the user agen header also. which is visible there you can assume it can be spoofed and is not reliable. get_browser() also use $_SERVER['HTTP_USER_AGENT']. so there is no determined way to detect browser. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.