vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP - Identify User's Continent? (https://vborg.vbsupport.ru/showthread.php?t=104136)

akanevsky 12-31-2005 11:38 PM

PHP - Identify User's Continent?
 
How can you identify user's continent via PHP? (ex: http://www.talkloud.net/forums/vbsta...&action=region)
Or maybe there is a country=>continent mapping database? Thanks.

Paul M 12-31-2005 11:46 PM

Simple answer - you can't.

You could try a reverse dns lookup on their ip and see if it's a country based url (like xxxx.co.uk) - but if it's .net or .com you're out of luck.

You could also see if you can extract any language information from their browser user-agent, or possibly a bit of JS to check their pc locale - but there is no foolproof method.

akanevsky 12-31-2005 11:50 PM

There is no "you can't" in this world. Every question has an answer.

As for this, simple and honest answer is "I don't know."

Now, there are databases which have the info.
My question is: Where can I get such database (for free)? Even if it's not PHP?

Paul M 12-31-2005 11:54 PM

Even they are not perfect - they normally rely on ip to location lookups, but even that is not 100% accurate (even assuming you can get the users real ip). I'm afraid I don't know where you could get such a database.

akanevsky 12-31-2005 11:56 PM

This is just for statistics, it does not need to be accurate. I making a stats hack, whose features are to be a rip off of Bane's vbstats hack which will apparently never be released... So I just want to know any method to replicate that.

EDIT:
I think I just found a nice database. I'll need to adjust its syntax to fit my needs... and I don't even think I'ma do it by hands. I'ma make me a nice lil php script that will do all the dirty work of syntax conversion for me ;)

Paul M 01-01-2006 12:11 AM

Most stats hacks use the reverse dns lookup method - and assume .net and .com to be the USA. If you 've found a usable database then that would probably be better. :)

akanevsky 01-01-2006 12:22 AM

Last time I checked, regular site visitors don't have a domain name associated with them ;) Happy new year btw!

soulfly 01-01-2006 12:55 AM

ment you in postbit? or for every action the user does

baronvonwalz 01-01-2006 03:39 AM

Well IP address blocks are reserved by various companies, which vary from area to area.

I suppose you could create a database in which it would analyze their ip and match it to a list of known IP address blocks, which would compare it to a list of blocks by country.

soulfly 01-01-2006 05:30 AM

Psionic Vision, if you need an ip->country db let me know i have one *bg*, there are which includes the shortname of country and longname, but no continent info, you could add id by yourself, if needed->post here.

best regards, soulfly


All times are GMT. The time now is 11:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00953 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete