Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to detect browser type 1

Status
Not open for further replies.

Jeet2004

MIS
Jun 29, 2005
96
US
what i need to do this if a user is using non IE browser then direct him to a different page with a message that they are not using IE so cant use the website and if they are using IE then show them different page.

I dont know how to detect the browser.

Thanks for your help
 
got it how to do it Just posting so that if someone needs would know how to...:)


<%
dim strUA
strUA = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(strUA, "MSIE") Then
response.redirect "desiredpage.asp"
else %>
<SCRIPT LANGUAGE="Javascript">
alert("<% ="Your web browser is not compatible with the website." %>")
</SCRIPT>
<%end if %>
 
Another possibility is to use an object that is (was?) built in for these purposes. You may need to update the browscap.ini file to include more recent matches, but I managed to find an article that not only describes the process but also provides a link and info on updating your browscap.ini file.

Another site I have used in the past for up to date browscap files is here:
barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top