ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!

Download and Activate to enter!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Download to Enter | Contest Rules

Learn More!

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 15th, 2008, 02:22 AM
Kyriakos Kyriakos is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 76 Kyriakos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 8 h 6 m 45 sec
Reputation Power: 6
Exclamation Detect the browser with ASP

hi everyone,

i have this script in PHP that detects the browser of the visitor but i want to translate this to ASP.
PHP Code:
if (ereg("msie"$br)) {
this
} else {
other



thanks in advance!

Reply With Quote
  #2  
Old September 15th, 2008, 02:33 AM
webb webb is offline
Help and be helped
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2004
Location: Australia
Posts: 582 webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level)webb User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 3 h 9 m 26 sec
Reputation Power: 121
Code:
If InStr(1, Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") then
  Response.Write "IE"
Else
  Response.Write "NOT IE"
End If
Comments on this post
micky agrees!
__________________
Life is Good

Reply With Quote
  #3  
Old September 15th, 2008, 02:35 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information.
 
Join Date: Jan 2005
Location: India
Posts: 13,634 micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)micky User rank is General 25th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 6 Months 2 Weeks 3 Days 2 h 28 sec
Reputation Power: 2670
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #4  
Old September 15th, 2008, 02:39 AM
Kyriakos Kyriakos is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 76 Kyriakos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 8 h 6 m 45 sec
Reputation Power: 6
Quote:
Originally Posted by webb
Code:
If InStr(1, Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") then
  Response.Write "IE"
Else
  Response.Write "NOT IE"
End If


thank you my friend. it's working.

Reply With Quote
  #5  
Old September 15th, 2008, 02:41 AM
icoombs's Avatar
icoombs icoombs is offline
Moderator
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Dec 2006
Location: West London, UK
Posts: 2,689 icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level)icoombs User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 3 h 42 m
Reputation Power: 929
Send a message via MSN to icoombs Send a message via Skype to icoombs
Hi

You have to use the Request.ServerVairables("HTTP_USER_AGENT") which will return the following for IE 7...

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727)

You can then use...

Code:
strBrowser = Request.ServerVairables("HTTP_USER_AGENT")
If InSrt(strBrowser, "MSIE7") > 0 Then
    strUserBrowser = "IE 7"
Elseif InStr(strBrowser, "Mozilla/5.0") > 0 Then
    strUserBrowser = "FireFox"
End if


You need to add an elseif for each browser user agent string.
__________________
Hope this advice helps.

If so please show your appreciation by adding reputation points (click gauge image on top right of this post).

- Post your code - Post your errors - Be clear - Be courteous -

AND PLEASE...Finalise your thread with a solution or confirmation that the last advice worked or failed.

Visit My ASP Free Members Club Profile

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Detect the browser with ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 



Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap