Home > Archive > PHP Language > December 2004 > Is this possible using php....
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Is this possible using php....
|
|
| toedipper 2004-12-22, 8:59 pm |
| Hello,
I am using php on my site and I would love it if a visitor comes to my site
and a message on my site could say "A big hello all users from
'whatever-country-you-are-from" etc.
Here is a site that displays something similar, I am not sure how it is
done. Look for it on the green scrolling banner.
http://www.komar.org/cgi-bin/xmas_webcam
Is it possible to do this is php? Is there a variable or something that can
extract what country the browser is coming from?
Thanks,
td.
| |
| Janwillem Borleffs 2004-12-23, 3:58 am |
| toedipper wrote:
> Is it possible to do this is php? Is there a variable or something
> that can extract what country the browser is coming from?
>
Yes, you can. I have implemented the database from
http://ip-to-country.webhosting.info/ in my website.
They also provide example scripts.
JW
| |
|
| On Wed, 22 Dec 2004 22:47:02 -0000, toedipper
<send_rubbish_here734@hotmail.com> wrote:
> http://www.komar.org/cgi-bin/xmas_webcam
"Your Country Capital : Washington, DC
Your Country Code : US
Your Country Currency : US Dollar "
Oh, how THANKFUL I am I found this site. I did not know my nation's
capital or its currency!
What the freakin' hell is the point of this? Absolutely inane.
| |
| Sebastian 'CrashandDie' Lauwers 2004-12-23, 8:56 am |
| Neal wrote:
> "Your Country Capital : Washington, DC
> Your Country Code : US
> Your Country Currency : US Dollar "
>
> Oh, how THANKFUL I am I found this site. I did not know my nation's
> capital or its currency!
The worst is, it isn't even correct... It displays exactly the same
thing for me, and I'm far from living in the US...
Thus, to answer your question, yes, it is quite easy to say that one
user is from one country just by looking at it's IP adress, but I think
i've just proven it's far from beeing very very precise...
For info: I'm in france...
> What the freakin' hell is the point of this? Absolutely inane.
Inane you say?
Best regards,
S.
| |
| Keith R 2004-12-23, 3:58 pm |
|
">
> Thus, to answer your question, yes, it is quite easy to say that one user
> is from one country just by looking at it's IP adress,...
IPv4 carries no notion whatsoever of geographical location. I assume you
meant to say it is easy to lookup the registered trustee of any allocated
block of the address space. Consider a VPN server within some address
space, the trustee could be registered in one location & all clients could
be physically located anywhere in the world. Do not use IPv4 lookup to get
physical location.
IPv6 however ...
http://www.cisco.com/univercd/cc/td...to_doc/ipv6.htm
Regards,
Keith
| |
| Sebastian 'CrashandDie' Lauwers 2004-12-23, 3:58 pm |
| Keith R wrote:
> IPv4 carries no notion whatsoever of geographical location. I assume you
> meant to say it is easy to lookup the registered trustee of any allocated
> block of the address space. Consider a VPN server within some address
> space, the trustee could be registered in one location & all clients could
> be physically located anywhere in the world. Do not use IPv4 lookup to get
> physical location.
Yes, that is indeed what i meant, to be more precise, I meant that it is
possible, very easily, but very, very imprecise... Any AOL user in the
world would be seen as resident in the US, same thing for any 'Free'
user.. (proxad)... And of course, anyone behind a proxy.
I haven't found the time yet to look closely at IPv6, i'm sure there are
some major improvements (btw, this question people keep asking all
around me... Where went IPv5?), so i'm sorry if my answer was misleading.
> Regards,
> Keith
Best regards, and happy Xmas to everyone
S.
| |
| Keith R 2004-12-23, 3:58 pm |
|
"Sebastian 'CrashandDie' Lauwers" <crashanddie+news@gmail.com> wrote in
message news:41cb1acd$0$9597$626a14ce@news.free.fr...
> Keith R wrote:
>
> some major improvements (btw, this question people keep asking all around
> me... Where went IPv5?),
Quote from http://www.oreillynet.com/pub/wlg/3316
But, what ever happened to IPv5?
IPng, Internet Protocol next generation, was conceived in 1994 with a goal
for implementations to start flooding out by 1996 (yeah, like that ever
happened). IPv6 was supposed to be the "god-send" over the well-used IPv4:
it increased the number of bytes used in addressing from 4 bytes to 16
bytes, it introduced anycast routing, it removed the checksum from the IP
layer, and lots of other improvements. One of the fields kept, of course,
was the version field -- these 8 bits identify this IP header as being of
version "4" when there is a 4 in there, and presumably they would use a "5"
to identify this next gen version. Unfortunately, that "5" was already given
to something else.
In the late 1970's, a protocol named ST -- The Internet Stream Protocol --
was created for the experimental transmission of voice, video, and
distributed simulation. Two decades later, this protocol was revised to
become ST2 and started to get implemented into commercial projects by groups
like IBM, NeXT, Apple, and Sun. Wow did it differ a lot. ST and ST+ offered
connections, instead of its connection-less IPv4 counterpart. It also
guaranteed QoS. ST and ST+, were already given that magical "5".
And now as the Internet clock ticks, our PCs don't use IPv5. So we're moving
onto 6.
I never knew that either! Never even occured to me to ask:-)
Seasons greetings
Keith
>
>
> Best regards, and happy Xmas to everyone
> S.
| |
| Janwillem Borleffs 2004-12-23, 8:56 pm |
| Sebastian 'CrashandDie' Lauwers wrote:
> The worst is, it isn't even correct... It displays exactly the same
> thing for me, and I'm far from living in the US...
>
Just being curious, but when you go to
http://ip-to-country.webhosting.info/, do you see the correct country then?
JW
| |
| Sebastian 'CrashandDie' Lauwers 2004-12-25, 3:56 pm |
| Janwillem Borleffs wrote:
> Just being curious, but when you go to
> http://ip-to-country.webhosting.info/, do you see the correct country then?
Yes it displays the correct one this time. Whether I had a weirdo IP
last time, whether this website is more accurate?
> JW
S.
| |
| Keith R 2004-12-26, 8:55 am |
|
"Sebastian 'CrashandDie' Lauwers" <crashanddie+news@gmail.com> wrote in
message news:41cb1acd$0$9597$626a14ce@news.free.fr...
> Keith R wrote:
>
> some major improvements (btw, this question people keep asking all around
> me... Where went IPv5?),
Quote from http://www.oreillynet.com/pub/wlg/3316
But, what ever happened to IPv5?
IPng, Internet Protocol next generation, was conceived in 1994 with a goal
for implementations to start flooding out by 1996 (yeah, like that ever
happened). IPv6 was supposed to be the "god-send" over the well-used IPv4:
it increased the number of bytes used in addressing from 4 bytes to 16
bytes, it introduced anycast routing, it removed the checksum from the IP
layer, and lots of other improvements. One of the fields kept, of course,
was the version field -- these 8 bits identify this IP header as being of
version "4" when there is a 4 in there, and presumably they would use a "5"
to identify this next gen version. Unfortunately, that "5" was already given
to something else.
In the late 1970's, a protocol named ST -- The Internet Stream Protocol --
was created for the experimental transmission of voice, video, and
distributed simulation. Two decades later, this protocol was revised to
become ST2 and started to get implemented into commercial projects by groups
like IBM, NeXT, Apple, and Sun. Wow did it differ a lot. ST and ST+ offered
connections, instead of its connection-less IPv4 counterpart. It also
guaranteed QoS. ST and ST+, were already given that magical "5".
And now as the Internet clock ticks, our PCs don't use IPv5. So we're moving
onto 6.
I never knew that either! Never even occured to me to ask:-)
Seasons greetings
Keith
>
>
> Best regards, and happy Xmas to everyone
> S.
| |
| Janwillem Borleffs 2004-12-26, 3:55 pm |
| Sebastian 'CrashandDie' Lauwers wrote:
> Yes it displays the correct one this time. Whether I had a weirdo IP
> last time, whether this website is more accurate?
>
I think the latter is the case, their database is quite good.
JW
|
|
|
|
|