Country of origin

M

Mettá

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
 
J

Jeff Cochran

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
 
M

Mettá

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
 
J

Jeff Cochran

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
 
M

Mettá

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
 
J

Jeff Cochran

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
 
P

Patrice

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
 
T

teknohippy

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.
 
A

Adrienne

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%>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top