Country of origin

Discussion in 'ASP General' started by Mettá, Jan 29, 2005.

  1. Mettá

    Mettá Guest

    Hi

    I am trying to set page content to reflect where the user may come from.

    Is there a fairly simple way to tell where web page requests are coming
    from? (Site is on a Win2003 server)

    i.e. something like (I know it not real)
    <%If Request.ServerVariable(".HTTP_USER_ COUNTRY")="UK" Then %> ...

    Thanks
    M

    --

    http://www.MettaWeb.com
    Mettá, Jan 29, 2005
    #1
    1. Advertising

  2. Mettá

    Jeff Cochran Guest

    On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
    <> wrote:

    >I am trying to set page content to reflect where the user may come from.
    >
    >Is there a fairly simple way to tell where web page requests are coming
    >from? (Site is on a Win2003 server)


    Yep. Ask the user.

    Jeff
    Jeff Cochran, Jan 29, 2005
    #2
    1. Advertising

  3. Mettá

    Mettá Guest

    Yes! ...and I thought another way might be to do this automatically to help
    visitors rather than get them to click an icon or whatever!

    Any helpful suggestions appreciated.

    M

    --

    http://www.MettaWeb.com


    "Jeff Cochran" <> wrote in message
    news:...
    > On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
    > <> wrote:
    >
    >>I am trying to set page content to reflect where the user may come from.
    >>
    >>Is there a fairly simple way to tell where web page requests are coming
    >>from? (Site is on a Win2003 server)

    >
    > Yep. Ask the user.
    >
    > Jeff
    Mettá, Jan 29, 2005
    #3
  4. Mettá

    Jeff Cochran Guest

    On Sat, 29 Jan 2005 21:23:44 -0000, "Mettá"
    <> wrote:

    >Yes! ...and I thought another way might be to do this automatically to help
    >visitors rather than get them to click an icon or whatever!


    With what are you going to identify the user's country? You might
    read it from a piece of data on their system, though not from ASP.
    And not if they use a laptop from Uruguay while vacationing in
    Paraguay. Unless you ask, you can't find out what country the user is
    in.

    Jeff
    Jeff Cochran, Jan 30, 2005
    #4
  5. Mettá

    Mettá Guest

    Thanks for your response, however I am wondering how site stats packages
    record (slightly inaccurately) visitors by country? I thought it might be
    possible to use this information to set some page content with an option to
    change it if the country is incorrect?

    Thanks
    M

    --

    http://www.MettaWeb.com


    "Jeff Cochran" <> wrote in message
    news:...
    > On Sat, 29 Jan 2005 21:23:44 -0000, "Mettá"
    > <> wrote:
    >
    >>Yes! ...and I thought another way might be to do this automatically to
    >>help
    >>visitors rather than get them to click an icon or whatever!

    >
    > With what are you going to identify the user's country? You might
    > read it from a piece of data on their system, though not from ASP.
    > And not if they use a laptop from Uruguay while vacationing in
    > Paraguay. Unless you ask, you can't find out what country the user is
    > in.
    >
    > Jeff
    Mettá, Jan 30, 2005
    #5
  6. Mettá

    Jeff Cochran Guest

    On Sun, 30 Jan 2005 09:45:34 -0000, "Mettá"
    <> wrote:

    >Thanks for your response, however I am wondering how site stats packages
    >record (slightly inaccurately) visitors by country? I thought it might be
    >possible to use this information to set some page content with an option to
    >change it if the country is incorrect?


    Look at the IP address assignments for countries and use that to base
    your pages on. It's not accurate, and may tick off visitors who
    aren't from the country you determined they are. Domains are more
    accurate, buy only if the TLD is a country domain.

    Jeff
    Jeff Cochran, Jan 30, 2005
    #6
  7. Mettá

    Patrice Guest

    ACCEPT_LANGUAGES ?

    Waht is this for. Is this to lnow where is rezlly rhe user or just to see
    what is the language he prefers ?

    Patrice

    --

    "Mettá" <> a écrit dans le message de
    news:%...
    > Hi
    >
    > I am trying to set page content to reflect where the user may come from.
    >
    > Is there a fairly simple way to tell where web page requests are coming
    > from? (Site is on a Win2003 server)
    >
    > i.e. something like (I know it not real)
    > <%If Request.ServerVariable(".HTTP_USER_ COUNTRY")="UK" Then %> ...
    >
    > Thanks
    > M
    >
    > --
    >
    > http://www.MettaWeb.com
    >
    >
    >
    Patrice, Jan 31, 2005
    #7
  8. Mettá

    teknohippy Guest

    On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
    <> wrote:

    >Hi
    >
    >I am trying to set page content to reflect where the user may come from.
    >
    >Is there a fairly simple way to tell where web page requests are coming
    >from? (Site is on a Win2003 server)
    >
    >i.e. something like (I know it not real)
    ><%If Request.ServerVariable(".HTTP_USER_ COUNTRY")="UK" Then %> ...
    >
    >Thanks
    >M


    You can determine country of origin by IP, but not 100% accurately.

    There are free and paid for databases out there for this, the paid for
    ones are more accuarate and updated more frequently.

    Basically they contain IP address ranges and the country that those
    ranges are assigned to and you simply do a lookup on the IP address.

    At the best though they still can't promise 100% coverage.

    For example big ISPs like AOL though can report all their IPs as being
    USA even though it may be a UK AOL user.

    I have a site that trys to do a detection to determine what currency
    to display, but it also offers the user the choice to change, as it
    can't be 100% correct then don't force the user to use your site in a
    particular way based upon the detection.

    Have a search on google for "free geographic IP csv" or some such.



    --
    Iain Norman | http://www.eliteforum.org
    teknohippy, Jan 31, 2005
    #8
  9. Mettá

    Adrienne Guest

    Gazing into my crystal ball I observed "Patrice" <>
    writing in news::

    > ACCEPT_LANGUAGES ?
    >
    > Waht is this for. Is this to lnow where is rezlly rhe user or just to
    > see what is the language he prefers ?
    >
    > Patrice
    >


    The term is HTTP_ACCEPT_LANGUAGES. It's what the browser sends the
    server. It is the user's preferred language, not where the person is.

    This could be useful if you had more than one language available on a
    site, for example;

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%If
    Instr(Request.Servervariables("HTTP_ACCEPT"),"application/xhtml+xml") > 0
    Then
    Response.ContentType = "application/xhtml+xml; charset=iso-8859-1"
    Else
    Response.contentType = "text/html; charset=iso-8859-1"
    End If
    If Request.Servervariables("HTTP_ACCEPT_LANGUAGES") = "fr" Then %>
    <html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
    <!--#include file="frenchmenu.inc"-->
    <%Else%>
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <!--#include file="englishmenu.inc"-->
    <%End If%>

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Feb 2, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S.Guhananth
    Replies:
    1
    Views:
    543
    Alvin Bruney [Microsoft MVP]
    Apr 30, 2005
  2. Nicol Nghia
    Replies:
    0
    Views:
    349
    Nicol Nghia
    Dec 3, 2005
  3. Zyron
    Replies:
    2
    Views:
    1,495
    Jukka K. Korpela
    Nov 8, 2005
  4. Petr Janda
    Replies:
    2
    Views:
    156
    rretzbach
    Mar 8, 2007
  5. Mel

    country of origin of a given IP

    Mel, Apr 18, 2005, in forum: Javascript
    Replies:
    5
    Views:
    81
    Grant Wagner
    Apr 19, 2005
Loading...

Share This Page