Results 1 to 3 of 3

Thread: Detect Country?

  1. #1

    Thread Starter
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126

    Question

    How do I detect the browser's Country?

    Using the HTTP_USER_AGENT server variable?

    I want to achieve a similar effect to the www.Altavista.com site, where they popup relevant content based on the users location.

    I only *really* need to know if the browser is in North America or not.

    Thanks,
    benski

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    Use the following:
    Code:
    Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
    This returns en-gb for us here in England, so you should be able to parse '??-us'?
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3

    Thread Starter
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126
    Nice one Jerry- Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width