PHP Operating System Detection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Catz
Forum Newbie
Posts: 8
Joined: Wed Dec 15, 2004 4:08 pm

PHP Operating System Detection

Post by Catz »

Hi All!

I have a custom popup script that works fine with Windows XP Professional, but not with XP Home. I want to add a php detection script that will detect wether the user is using XP Home or XP Professional and then redirect the user according to these variables. Any ideas how this can be done?

Thanks!
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Your pop-up script is not dependent on the OS - its the Web Browser and its version you need to check.
you can do this either using JS or PHP.
Javascript : navigator.userAgent
PHP : $_SERVER['HTTP_USER_AGENT']
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

which are optional headers.. do not rely on them to exist.
Post Reply