Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > PHP
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 05-09-2002, 06:31 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
detect o/s ..

i would love to find a script that allows me to detect what o/s people are running ... hmmm .. i think i will investigate this today =)
__________________
sde is offline   Reply With Quote
Old 05-09-2002, 04:59 PM   #2 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
Well, PHP will do that for you, in a way. You can use the $HTTP_USER_AGENT string to grab what type of browser they're using, and just use a little flow control to deduce which OS. There may very well be another method in PHP, but I don't know it (yet).

Here's a quick example I had worked up awhile back:

Code:
$HTTP_USER_AGENT and strstr() function call: <?php if (strstr($HTTP_USER_AGENT, "MSIE")) { ?> <p align="left">You're using a Microsoft OS.</p> <? } else if (strstr($HTTP_USER_AGENT, "Mozilla")) { ?> <p align="left">You're using an opensource OS.</p> <? } print $HTTP_USER_AGENT; ?>
__________________
bdl is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CodeNewbie helps detect Konquerer Bug . . . sde Lounge 1 02-19-2004 01:22 AM
o/s poll : linux still running strong sde Lounge 5 03-18-2003 11:47 AM


All times are GMT -8. The time now is 04:56 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle