Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

browser detection script

Posted on 2003-10-21
6
Medium Priority
?
181 Views
Last Modified: 2013-12-24
i need to make a browser detection script, and instead of trying to analyze all the user-agent strings myself, i figured that someone out there has probably already done the work.  i need it to detect all the latest browsers (i.e. Netscape 7 vs. 6 vs. 4.x)

if you have a script that isn't in CFML it is okay as long as i can see the algorithm you used

thanks,

justin
0
Comment
Question by:newstandard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Expert Comment

by:CFDevHead
ID: 9591402
here something simple and it works

function browserRedirect()
{
  var ns4 = document.layers;
  var ns7 = document.getElementById && !document.all;
  var ie6 = document.all;
 
  if(ns4) URLStr = "1.html";
  else if(ns7) URLStr = "2.html";
  else if(ie6) URLStr = "3.html";
  else URLStr = "4.html";
  location = URLStr;
}
browserRedirect()
0
 

Author Comment

by:newstandard
ID: 9591502
i need something that can be done using analysis of the UserAgent string because i am doing something server side - that means i can't use javascript
0
 
LVL 17

Accepted Solution

by:
anandkp earned 750 total points
ID: 9592402
using HTTP_User_Agent -
u'll need to send the information to the server [thru form submit or url ... whatever]

Parse the string & chk for the existance of MSIE [indicates its a IE] else its a NetScape.
there u'll also see the version number ...

I dont know what opera or other browsers show up :)

0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 11

Expert Comment

by:hart
ID: 9596659
anand is right :-)

for server side check
<CFIF FINDNOCASE("MSIE",HTTP_USER_AGENT) EQ 0>            
   not ie
</CFIF>

Regards
Hart
0
 

Expert Comment

by:dvsmind247
ID: 9597264
There's a pretty good custom tag that already does this called <cf_whodat>.

Here's the link:http://www.teratech.com/ColdCuts/cutdetail.cfm?cutid=296

~cheers
dvsmind247
0
 

Expert Comment

by:watersdm
ID: 9608033
Don't waste your time with half-baked, half-working solutions. If browser detection is important to you then spend a few hundred dollars on a reliable, comprehensive solution such as Browserhawk (http://www.browserhawk.com).

David
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question