Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Country of origin

Reply
Thread Tools

Country of origin

 
 
Mettá
Guest
Posts: n/a
 
      01-29-2005
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



 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      01-29-2005
On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Mettá
Guest
Posts: n/a
 
      01-29-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
> <(E-Mail Removed)> 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



 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      01-30-2005
On Sat, 29 Jan 2005 21:23:44 -0000, "Mettá"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Mettá
Guest
Posts: n/a
 
      01-30-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Sat, 29 Jan 2005 21:23:44 -0000, "Mettá"
> <(E-Mail Removed)> 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



 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      01-30-2005
On Sun, 30 Jan 2005 09:45:34 -0000, "Mettá"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      01-31-2005
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á" <(E-Mail Removed)> a écrit dans le message de
news:%(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
teknohippy
Guest
Posts: n/a
 
      01-31-2005
On Sat, 29 Jan 2005 11:58:45 -0000, "Mettá"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Adrienne
Guest
Posts: n/a
 
      02-02-2005
Gazing into my crystal ball I observed "Patrice" <(E-Mail Removed)>
writing in news:(E-Mail Removed):

> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kenya-France July 2008 Travel Pictures Country next to Country BoBi Digital Photography 0 07-13-2008 06:55 AM
Kenya-Belgium June 2008 Travel Pictures Country next to Country BoBi Digital Photography 0 06-01-2008 03:12 PM
Country list with iso1366 codes and local country names Zyron HTML 2 11-08-2005 04:55 PM
Onchange of dropdownlist say "country" loaded,it must load all "states" for that country in another drop downlist. S.Guhananth ASP .Net 1 04-30-2005 12:01 PM
country of origin of a given IP Mel Javascript 5 04-19-2005 03:09 PM



Advertisments