Free IP Gelocation Database

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.

Published
Categorised as 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

Published
Categorised as PHP

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