...

View Full Version : Mac or pc detection



Baleric
02-05-2007, 01:34 AM
hey guys,
is there an asp script that detects the if PC or MAC?
i have a flash file that detects the windows system clock but cannot detect the mac clock,

i just need to put it in an if statemnt eg.

if computer = mac then
'Mac
else
'PC
end if

thanks in advance,

cheers

baleric

Spudhead
02-06-2007, 11:56 AM
This is a client-side javascript question?

felgall
02-06-2007, 08:12 PM
This is a client-side javascript question?

No it isn't because Javascript has no access to the hardware to determine what sort of computer it is.

Javascript is even dependent on the browser identifying the operating system and the browser wont correctly identify operating systems released after it was and may not correctly identify operating systems released before it was. If someone has a Mac that is running Windows XP and IE6 then chances are that the operating system will be reported as Windows 5 and that there will be no indication whatever that it is a Mac rather than a PC.

Spudhead
02-07-2007, 03:13 PM
Ok, let me put it another way: it's not an ASP question, and you're probably going to have more luck resolving the underlying issue by moving this into the client-side javascript forum - where most questions about identifying the client platform occur - than in here where only two of us have replied and we can't even agree on an answer.

fractalvibes
02-07-2007, 11:54 PM
Coudn't you get your answer from the Request.ServerVariables collection?

fv

oracleguy
02-08-2007, 08:05 AM
The server variables give you information about the server (hence the name) not the client.

felgall
02-08-2007, 08:17 PM
You can't get information about the client unless the client is configured to tell you. If the client has decent security installed then it wont tell you much. If the person is running Internet Explorer then you know that they are running Windows because that is the only operating system that IE runs on but there is still no way to tell if they are running Windows on a PC or a Mac The only browser where you can be sure they are using a Mac is Safari as that browser only runs on the Mac. All other browsers run on at least PCs and Macs and many of them also run on PDAs, Mobile Phones, and numerous other devices. Apast from the available display window the device that the browser is running on is irrelevant as far as the browser displaying web pages is concerned and the browser only knows as much about the hardware as the operating system tells it anyway (which is almost nothing).

degsy
02-13-2007, 03:55 PM
The HTTP_USER_AGENT server variable will give you info about the browser and OS.

Note that those details can be spoofed, so it is not 100% reliable.


Have a look at this Javascript Browser Sniffer script to see some of the things you can check for in the HTTP_USER_AGENT server variable.
http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html

fractalvibes
02-14-2007, 05:31 AM
You can't get information about the client unless the client is configured to tell you. If the client has decent security installed then it wont tell you much. If the person is running Internet Explorer then you know that they are running Windows because that is the only operating system that IE runs on but there is still no way to tell if they are running Windows on a PC or a Mac The only browser where you can be sure they are using a Mac is Safari as that browser only runs on the Mac. All other browsers run on at least PCs and Macs and many of them also run on PDAs, Mobile Phones, and numerous other devices. Apast from the available display window the device that the browser is running on is irrelevant as far as the browser displaying web pages is concerned and the browser only knows as much about the hardware as the operating system tells it anyway (which is almost nothing).

Actually Macs will run older versions of IE. There is a Mac laptop sitting in my kitchen with IE loaded on it running Mac OS X. For that matter, it could be a Linux machine running the Wine emulator running IE (why bother? ;-)


fv



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum