This series is about code in various languages that will calculate the distance between two latitudes and longitudes. This article is for the PHP code. Code courtsey : GeoDataSource /*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ /*:: :*/ /*:: This routine calculates the distance between two :*/ /*:: points (given the latitude/longitude of those points). :*/ /*:: It is being used… Continue reading Distance between two Latitudes and Longitudes – Part 1
Free IP Gelocation Database
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