SandySynaptik 6 Posted October 30, 2011 Report 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? Quote Link to post Share on other sites
Ingolme 1,020 Posted October 30, 2011 Report 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. Quote Link to post Share on other sites
SandySynaptik 6 Posted October 30, 2011 Author Report 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? Quote Link to post Share on other sites
Ingolme 1,020 Posted October 30, 2011 Report 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. Quote Link to post Share on other sites
SandySynaptik 6 Posted October 30, 2011 Author Report 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. Quote Link to post Share on other sites
SandySynaptik 6 Posted October 30, 2011 Author Report Share Posted October 30, 2011 any javascript method? Quote Link to post Share on other sites
Ingolme 1,020 Posted October 30, 2011 Report Share Posted October 30, 2011 Javascript has the Navigator object. But that's also unreliable. Quote Link to post Share on other sites
Don E 125 Posted October 30, 2011 Report 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? Quote Link to post Share on other sites
Ingolme 1,020 Posted October 30, 2011 Report 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. Quote Link to post Share on other sites
birbal 168 Posted October 31, 2011 Report Share Posted October 31, 2011 (edited) 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. Edited October 31, 2011 by birbal Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.