Getting IP geolocation [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have a database that has a "users" table where i have a last_login_ip field for each user that stores the IP address of the device where they last visited my website. I'd like to know country, city and state of all my visitors. I've been investigating IP addresses theory but i can't find a way to get this information aside of websites that already have this service, the problem with these websites is that i have to insert each IP address individually and i can't do that to 4000+ users. What would be the best way to do this?

There are a lot of APIs to do that. Like for example this one very simple :
http://www.hostip.info/use.html
An example of code in php using this API would be
<?php
$ip = "replace_with_your_ip";
// Get country
$data = file_get_contents("http://api.hostip.info/country.php?ip=".$ip);
//Get other location infos
$data = file_get_contents("http://api.hostip.info/?ip=".$ip);
?>
It can be more convenient in some case to use Javascript and make Ajax calls on these URLs.

Related

CSV Export/Import Column Mapping [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I have a company database (PHP and MYSql) where products needs to be exported and imported regularly. Due to the difference in column between companies, i need to export into their column format and except their format. I am after a script that will map the columns before exporting/importing. Open source would be the preferred choice. I searched the internet all day without any joy.
Thanks
(sorry I do not have 50 reputation to comment)
You should take a look here
https://dev.mysql.com/doc/refman/5.0/en/replication-howto.html
And then here
replication between two tables with different names and which have different column names. Is it possible to create such replication

Ready country list for Database? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want the user to enter their full address including a dropdown list of countries and cities that are updated based on the country selected.
Do I really have to manual create a country database table as well as all possible cities table and then make a giant php check to match the two?
I am sure there is a smarter way of doing it, but I could not seem to find one!
Later I will be using the country and city to filter the results that are displayed on the page.
Any help is much appreciated!
search search search
goto http://www.geonames.org you can find complete list of cities in the world
In particular, you can search over the dump list.
Sql dump of all the Countries, Country Codes, Phone codes

PHP duplicate content detection system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Are there any popular PHP libraries or services that can help detect duplicate content?
I run a site that has user generated content and I want to detect content that are similar or duplicated. Are there any popular libraries out there that can help with this?
Text similarity/plagiat/duplicate is a big topic. There are so many algos and solutions.
Some projects use the "adaptive local alignment of keywords" (you will find info on that on google.)
Also, you can check this (Check the 3 links in the answer, very instructive):
Cosine similarity vs Hamming distance
Hope this will help.

Business Registration. A way to verify business is actually a business? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Is there a way to verify that the business signing up is actually a place of business? I found a thread on Stackoverflow, Verify Business Identity, but it did not actually answer the question directly. So here is the issue and question.
A website allows businesses to register to their site. What can be done to verify that an actual place of business, that has employees, is signing up and not just some random person creating bogus accounts for non-existent companies?
You could require/solicit from the company their EIN (Employer Identification Number). This is from the IRS, so it would only work for US-based companies. Some sole proprietors will not have one.
Here is a helpful source to get you started: http://www.sba.gov/community/blogs/community-blogs/business-law-advisor/how-do-i-find-ein
I would suggest you to look for Business Verification Services like this one http://datamarket.azure.com/dataset/dnb/businessverificationoffice

Tool or PHP code to convert IP address into lat/lng coordinates [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have thousands of IP addresses of visitors to my site, what tools can I use to convert these into lat/lng coordinates? I will then be able visualise the data on a map with filters for further demographics gathered.
For one of my sites I made use of maxmind's free geolite country database which can be downloaded here: http://www.maxmind.com/app/geolitecountry
They also provide a city level version which includes the long/lat: http://www.maxmind.com/app/geolitecity
but note that the accuracy on the free version is a lot lower than the paid version.
I suggest using Google Analytics to your problem, but if you want to try yourself here is a starting point:
Take a look at this link http://www.geoplugin.net/php.gp, you get a full list of details about that ip address position, including latitude and longitude.
It is not that acurate but it works, and I use it. Here is a php script actually in use :
<?php
$ip_addr = $_SERVER['REMOTE_ADDR'];
$geoplugin = unserialize( file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip_addr) );
if ( is_numeric($geoplugin['geoplugin_latitude']) && is_numeric($geoplugin['geoplugin_longitude']) ) {
$lat = $geoplugin['geoplugin_latitude'];
$long = $geoplugin['geoplugin_longitude'];
}
echo $ip_addr.';'.$lat.';'.$long;
?>
You can see it working at http://whateverhappens.org/ip-addr/
And that a look at the Geoplugin website examples.
this might also help https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6103179.html
http://www.telize.com and http://www.iptolatlng.com both provide solutions in JSON

Categories