humer2000
asked on
Detect MACINTOSH and Netscape Navigatoir via ASP
Hi
I knwo that we we can detect MAC and Netscape navigators and redirect them to specifi pages, all this via javascript
I would like to knwo if we can do this in asp (active server pages)
If yes, please give me an example with redirection to A or B page
I knwo that we we can detect MAC and Netscape navigators and redirect them to specifi pages, all this via javascript
I would like to knwo if we can do this in asp (active server pages)
If yes, please give me an example with redirection to A or B page
ASKER
this is very complicated
i need a simple script
i need a simple script
This (from phpBB2 skin) detect PC/Mac and IE/NS:
var clientPC = navigator.userAgent.toLowe rCase(); // Get client info
var clientVer = parseInt(navigator.appVers ion); // Get browser version
var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozill a')!=-1) && (clientPC.indexOf('spoofer ')==-1)
&& (clientPC.indexOf('compati ble') == -1) && (clientPC.indexOf('opera') ==-1)
&& (clientPC.indexOf('webtv') ==-1) && (clientPC.indexOf('hotjava ')==-1));
var is_win = ((clientPC.indexOf("win")! =-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!= -1);
So just test is_ie, is_nav, is_win, is_mac and use location.href = "yourpage.htm" to redirect
var clientPC = navigator.userAgent.toLowe
var clientVer = parseInt(navigator.appVers
var is_ie = ((clientPC.indexOf("msie")
var is_nav = ((clientPC.indexOf('mozill
&& (clientPC.indexOf('compati
&& (clientPC.indexOf('webtv')
var is_win = ((clientPC.indexOf("win")!
var is_mac = (clientPC.indexOf("mac")!=
So just test is_ie, is_nav, is_win, is_mac and use location.href = "yourpage.htm" to redirect
ASKER
hi please read my question
i am looking for asp code not php or javascript
i am looking for asp code not php or javascript
oh sorry, I've just read so fast and I saw something 'javascript' :-)
But both have the same approach: read USER_AGENT (here in ASP is request.servervariables("H TTP_USER_A GENT")) then test some specified pieces of text. If you find 'mac' then it's Mac, or 'win' then it's Windows...
But both have the same approach: read USER_AGENT (here in ASP is request.servervariables("H
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just forgot: redirect your browser by
Response.Redirect("YourPag eIE.asp")
Response.Redirect("YourPag
request.servervariables("H
my results are
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Rockman