By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,456 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,456 IT Pros & Developers. It's quick & easy.

Country of origin

P: n/a
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

Jul 22 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
<me**********@this-metta.org.uk> 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
Jul 22 '05 #2

P: n/a
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" <je*********@zina.com> wrote in message
news:41*****************@msnews.microsoft.com...
On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
<me**********@this-metta.org.uk> 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

Jul 22 '05 #3

P: n/a
On Sat, 29 Jan 2005 21:23:44 -0000, "Mettá"
<me**********@this-metta.org.uk> 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
Jul 22 '05 #4

P: n/a
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" <je*********@zina.com> wrote in message
news:41*****************@msnews.microsoft.com...
On Sat, 29 Jan 2005 21:23:44 -0000, "Mettá"
<me**********@this-metta.org.uk> 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

Jul 22 '05 #5

P: n/a
On Sun, 30 Jan 2005 09:45:34 -0000, "Mettá"
<me**********@this-metta.org.uk> 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
Jul 22 '05 #6

P: n/a
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á" <me**********@this-metta.org.uk> a écrit dans le message de
news:%2****************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #7

P: n/a
On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
<me**********@this-metta.org.uk> 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
Jul 22 '05 #8

P: n/a
Gazing into my crystal ball I observed "Patrice" <no****@nowhere.com>
writing in news:Ok**************@TK2MSFTNGP11.phx.gbl:
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"),"appl ication/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
Jul 22 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.