Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
Dim user_agent, mobile_browser, Regex, match, mobile_agents, mobile_ua, i, size
user_agent = Request.ServerVariables("HTTP_USER_AGENT")
mobile_browser = 0
Set Regex = New RegExp
With Regex
.Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm)"
.IgnoreCase = True
.Global = True
End With
match = Regex.Test(user_agent)
If match Then mobile_browser = mobile_browser+1
If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/vnd.wap.xhtml+xml") Or Not IsEmpty(Request.ServerVariables("HTTP_X_PROFILE")) Or Not IsEmpty(Request.ServerVariables("HTTP_PROFILE")) Then
mobile_browser = mobile_browser+1
End If
'list of devices, this is an array so just add more that come to the marketplace into here
mobile_agents = Array("alcatel", "amoi", "android", "avantgo", "blackberry", "benq", "cell", "cricket", "docomo", "elaine", "htc", "iemobile", "iphone", "ipad", "ipaq", "ipod", "j2me", "java", "midp", "mini", "mmp", "mobi", "motorola", "nec-", "nokia", "palm", "panasonic", "philips", "phone", "sagem", "sharp", "sie-", "smartphone", "sony", "symbian", "t-mobile", "telus", "up\.browser", "up\.link", "vodafone", "wap", "webos", "wireless", "xda", "xoom", "zte")
size = Ubound(mobile_agents)
mobile_ua = LCase(Left(user_agent, 4))
For i = 0 To size
If mobile_agents(i) = mobile_ua Then
mobile_browser = mobile_browser+1
Exit For
End If
Next
'check that full website has not been requested (you can have a link in the page for this like: view Full Site
If request.querystring("v")="full" then session("fullsite")=true
If mobile_browser>0 and session("fullsite")=false then
response.redirect("tablet.asp")
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
I got it! I took a sample codes out there (somewhere), forgot where I took the codes out but I Googled it... and has been using since. It really simple, just load you main page as usual except that the
Bookmarks