N-Bomb(Nerd) Posted November 29, 2009 Share Posted November 29, 2009 How can I tell the person browsing my site is running 32, or 64 bit operating system? Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/ Share on other sites More sharing options...
dragon_sa Posted November 29, 2009 Share Posted November 29, 2009 <?php echo $_SERVER['HTTP_USER_AGENT']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967293 Share on other sites More sharing options...
Alex Posted November 29, 2009 Share Posted November 29, 2009 That won't display the information that the OP is asking for. Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967296 Share on other sites More sharing options...
dragon_sa Posted November 29, 2009 Share Posted November 29, 2009 its contained in the variable you could explode that and derive it from that for example I am using 64bit win7 and that spits out Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2) WOW64 tells me 64bit, you could loop thru an array of various OS variables that would display and match it Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967300 Share on other sites More sharing options...
N-Bomb(Nerd) Posted November 29, 2009 Author Share Posted November 29, 2009 I'm using a 64 bit version of Windows 7.. and I'm not getting WOW64 when I check the user agent Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967303 Share on other sites More sharing options...
whit3fir3 Posted November 29, 2009 Share Posted November 29, 2009 That means that you are using a 32bit version of browser you are using. Checking $_SERVER['HTTP_USER_AGENT']; will only work if BOTH the operating system and the web browser are 64bit. Thanks, Whit3fir3 Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967304 Share on other sites More sharing options...
dragon_sa Posted November 29, 2009 Share Posted November 29, 2009 I stand corrected I can see that, that is a special part of my version of win7 called Windows on Windows, it does tell me its 64bit but as you just mentioned its not applicable to all 64bit OS's. Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967305 Share on other sites More sharing options...
N-Bomb(Nerd) Posted November 29, 2009 Author Share Posted November 29, 2009 I suppose I don't exactly need the bit version.. but how can I tell apart the different operating systems then? Is there a list somewhere that I can use for reference within the user agent? Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967309 Share on other sites More sharing options...
whit3fir3 Posted November 29, 2009 Share Posted November 29, 2009 Use the $_SERVER['HTTP_USER_AGENT'] and I think what you are looking for is 'platform' if I remember correctly. Once you find the element of the array that you need this list from Microsoft will help you find tell the different Windows Version apart: http://msdn.microsoft.com/en-us/library/ms537503%28VS.85%29.aspx Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967314 Share on other sites More sharing options...
trq Posted November 29, 2009 Share Posted November 29, 2009 I suppose I don't exactly need the bit version.. but how can I tell apart the different operating systems then? Is there a list somewhere that I can use for reference within the user agent? What do you need this for exactly? Relying on this information isn't exactly reliable. Its sent by the client after all. Quote Link to comment https://forums.phpfreaks.com/topic/183271-how-to-find-os-bit-version/#findComment-967332 Share on other sites More sharing options...
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.