Maxmind is providing IP Geolocation Database for free. Visit this page for the legacy database. And this page for the new database(work under process). These are updated monthly. And there is no support.
Category: PHP
Simulating a form submit using POST method through CURL
Below piece of code can simulate a form submission through post method. /******** The below header simulates Chrome Browser ********/ $header[0] = “Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8”; $header[1] = “Accept-Language: en-US,en;q=0.8”; $header[2] = “Cache-Control: max-age=0”; $header[3] = “Connection: keep-alive”; $header[4] = “Host: www.doamin-name.com”; $header[5] = “User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36”; $header[6]… Continue reading Simulating a form submit using POST method through CURL
Database of All Countries
Here is a MySQL dump of all the countries in one table. It is a pretty handy database with 2 char country codes, 3 char country codes and latitude and longitude (somewhat in the middle area) of each countries. Below are the columns of the table. And below is a sample of the data stored… Continue reading Database of All Countries
Image Cropping in PHP – Part 2
Here is the second part of the article “Image Cropping in PHP”. The first part is here This part describes the function imagecrop introduced in PHP 5.5.0 for cropping images. imagecrop can be used to crop an image based on a start and end point/co-ordinate and dimensions. (It doesn’t take into account any color like… Continue reading Image Cropping in PHP – Part 2
Image Cropping in PHP – Part 1
With PHP 5.5.0 two functions, imagecropauto and imagecrop, have been added for advanced image resizing. This article describes the imagecropauto function. The imagecropauto function is useful to remove borders or background/outer area of a photo. The mode parameter defines the border to be removed e.g. IMG_CROP_BLACK will remove black borders, IMG_CROP_WHITE will remove white borders… Continue reading Image Cropping in PHP – Part 1