472,787 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,787 software developers and data experts.

Detect the users operating system using PHP

Hi,

Is it possible to detect a users operating system using PHP or is this
something for Javascript? I ask because I am trying getting some bugs
with a minor javascript script that is generating bugs when run using
IE on the Mac. The javascript, although a fancy feature, isnt all that
important to the page so Im just going to disable it from the server
for Mac users (sorry guys), at least until I figure out the way it will
display on the Mac.

I havent yet tested it in non-IE browsers (Firefox, Opera etc) on the
Mac. Can I also find out what browser software the Mac user is using.
If it works in other Mac browsers I can simply just disable it for IE
Mac users.

Cheers

Burnsy

Jun 20 '06 #1
2 2576
On Tue, 20 Jun 2006 03:09:06 -0700, bizt wrote:
Is it possible to detect a users operating system using PHP or is this
something for Javascript? I ask because I am trying getting some bugs with
a minor javascript script that is generating bugs when run using IE on the
Mac. The javascript, although a fancy feature, isnt all that important to
the page so Im just going to disable it from the server for Mac users
(sorry guys), at least until I figure out the way it will display on the
Mac.

I havent yet tested it in non-IE browsers (Firefox, Opera etc) on the Mac.
Can I also find out what browser software the Mac user is using. If it
works in other Mac browsers I can simply just disable it for IE Mac users.


It's not always reliable (it can be faked), but $_SERVER["USER_AGENT"]
should do for your purposes.

Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

Jun 20 '06 #2
On Tue, 20 Jun 2006 03:09:06 -0700, bizt wrote:
Hi,

Is it possible to detect a users operating system using PHP or is this
something for Javascript? I ask because I am trying getting some bugs
with a minor javascript script that is generating bugs when run using
IE on the Mac. The javascript, although a fancy feature, isnt all that
important to the page so Im just going to disable it from the server
for Mac users (sorry guys), at least until I figure out the way it will
display on the Mac.

I havent yet tested it in non-IE browsers (Firefox, Opera etc) on the
Mac. Can I also find out what browser software the Mac user is using.
If it works in other Mac browsers I can simply just disable it for IE
Mac users.

Cheers

There is get_browser() function which will return a hash with different
fields, one of which is "platform". More details can be seen at:

http://us3.php.net/manual/en/function.get-browser.php

I can only imagine what the "stripper" field does.
--
http://www.mgogala.com

Jun 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
10
by: Gerald | last post by:
I'm new to DB2, I have over 10 years of experience on Oracle. I actually have to books on order that might help. Till then I have been searching and reading through IBM's DB2 Information Center,...
1
by: PL | last post by:
I read password from the console with _getcch to display no echo. The problem is that I don't know how to flush extended char and ignore them, like control+A, ... In fact, I want to detect the...
6
by: Fred Hedges | last post by:
Using .NET 1.1, I need to be able to detect if Themes are enabled or disabled, not for a specific application, but for the system as a whole (ie. the current user). The reason I need to be able to...
1
by: cefrancke | last post by:
I have a Back End database (split) that is on a smokin' hot machine (dual processor, 2 gig RAM, XP Pro SP2) and I'm getting an error that says the database (back end file) is "opened exclusively"...
1
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Dear Support, I'm not an ASP programmer, however so far by searching the web, I have created this working code: <html> <body> <p> <p> <b>School IP address:</b>
14
by: ayan4u | last post by:
how to detect which operating system is running using c/c++ so tht we can make portable codes.... for example: #include <windows.h> code... Sleep(200);
2
by: RP | last post by:
I want to detect user activity (mouse move, key click). For certain critical areas (Form in my app.), I want to check whether there is any user activity for a certain interval. If not, then I want...
35
by: nobody | last post by:
I need to pop up a modal JS-based dialog (for some reason can't use popup window, much less so showModalDialog()), and I'd like to imitate the system popup titlebar according to user's desktop...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.