Is there a way for my cgi program to find out the country from where the web
request originated? Is there an easy way to analyse the IP address to get
to this information? If so, will this slow down my response time?
Thanks,
Karel Vandehove
>Is there a way for my cgi program to find out the country from where the web
>request originated?
It might be possible to determine that by attempting a NLSLookup. If it's
from has a nation code, it usually is possible to infer that it's from that
nation, but not always the case (especial with .to domain names).
With .com, .edu, and .net names, you could do a Whois to see what nation it's
from.
This only works if the machine has a name, which sometimes isn't the case.
>Is there an easy way to analyse the IP address to get
>to this information?
Not usually. Those only indicate networks and subnetworks which may have
their own connection around the world.
HTH.
-- Support the anti-Spam amendment - Join at http://www.cauce.org/
J. Peter Mugaas E-Mail: oma0...@mail.wvnet.edu
http://wvnvm.wvnet.edu/~oma00215/ Finger for PGP key.
Try this:
function ExtractCountry(IPAddress:string):string;
var
strHost:string;
addr:longint;
hostptr:PHOSTENT;
begin
addr:=inet_addr(PChar(v));
hostptr:=gethostbyaddr(@addr,SizeOf(addr),PF_INET);
if hostptr<>nil then
strHost:=hostptr^.h_name;
result:=strHost;
// If you pass address 194.176.45.2 it will give you back
mydynamicip.myserver.mycountry (or whatever). You can then analyze the
string and extract everything from the last dot => country
end;
Karel Vandenhove wrote in message <6hf8cr$ik...@forums.borland.com>...
>Hi,
>
>Is there a way for my cgi program to find out the country from where the
web
forgot to mention to you to include the winsock to compile.
Would you know how to figure out the remote users language too?
Best regards,
Karel
Hadi Hariri heeft geschreven in bericht <6hfiff$j0...@forums.borland.com>...
--
Thu, 23 Apr 1998 08:45 EDT
Jim O'Brien, R&D, PTT, Inc.
wiz...@remove-this-prefix.ptti.com +1 (212) 972-1702
Jim O'Brien wrote in message ...