Determining Site Visitor Device Type

I need a concise way to determine if a user is on a mobile device or not using classic asp.  it would be nice, although not necessary, to know if they are using apple or pc.  I assume it has to do with Request.ServerVariables("HTTP_USER_AGENT")?

Thank you!
Bob SchneiderCo-OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Detect mobile user agent from classic ASP
Function is_mobile()
    Dim Regex, match
    Regex = New RegExp
    With Regex
        .Pattern = "(up.browser||mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm|ipad|Android|BlackBerry|iPhone|iPod|Palm|Symbian)"
        .IgnoreCase = True
        .Global = True
    End With
    match = Regex.test(Request.ServerVariables("HTTP_USER_AGENT"))
    If match Then
        is_mobile = True
        is_mobile = False
    End If
End Function

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob SchneiderCo-OwnerAuthor Commented:
Thank you very much!
Bob SchneiderCo-OwnerAuthor Commented:
Oops.  I get this on you rline 3: Object doesn't support this property or method Err #:
Bob SchneiderCo-OwnerAuthor Commented:
Oops again.  We're good!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.