You'll want to check #CGI.HTTP_USER_AGENT# and then parse it for the
browser and OS values.

A Macintosh will always have "Mac" somewhere in the string, but Windows
does not always put "Win" or "Windows" in the string.  So, if it doesn't
say "Mac", assume it's Windows.  It could be Unix, but Unix doesn't
consistently put a value in the user agent string either.  Besides, Unix
browsers are almost always closer to Windows than to Macintosh in terms of
browser functions.

Internet Explorer will always report "MSIE" somewhere in the string.  Opera
will report "Opera" unless it is set to spoof itself as some other browser.
Netscape does not consistently put a value into the string, so do the same
as with the OS and assume Netscape if you don't find either of these other
two.
|-----------------------------+-------------------------------------------|
|Eric A. Laney                |The closed mouth swallows no flies.        |
|Systems Engineer             |                                           |
|LAN Optimization Team        |                                           |
|Voice: 813.978.4404          |                          - Spanish proverb|
|Pager: 888.985.8519          |                                           |
|-----------------------------+-------------------------------------------|





                                                                                       
                                      
                    Dasher                                                             
                                      
                    <dasher@bentm        To:     CF-Talk <[EMAIL PROTECTED]>   
                                      
                    edia.com>            cc:                                           
                                      
                                         Subject:     Browser Sniffing and Serving 
StyleSheets                               
                    07/25/2001                                                         
                                      
                    12:11 PM                                                           
                                      
                    Please                                                             
                                      
                    respond to                                                         
                                      
                    cf-talk                                                            
                                      
                                                                                       
                                      
                                                                                       
                                      




I need to sniff the operating system (Mac or PC) and browser
(Netscape or IE) type using Cold Fusion, then serve that particular
configuration a particular StyleSheet based on that info.

Does anyone  have a solution or
know where I could look for this information?

Thanks!
-- Dasher
[EMAIL PROTECTED]
http://www.bentmedia.com/
Bent Media, Inc.
128 South Clark Street
New Orleans, LA 70119-6103
Phone - 504.488.2848 x19
Fax - 504.488.2979
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to