-------------------------------------------------------------------------
phpZipLocator
A PHP class to do distance and radius proximity calculations based on Zip Codes
Copyright (C) 2002 SANIsoft
This program is free software; you can redistribute it and/or modify
it under the terms of the Lesser GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the Lesser GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Tarique Sani <tarique@sanisoft.com>
Girish Nair <girish@sanisoft.com>
phpZipLocator Home <http://www.sanisoft.com/ziploc/ >
---------------------------------------------------------------------------
phpZipLocator needs a database with a table called zipData containing data for
ZipCodes to work properly
You can grab a zip file with the necesary data and table structure from here
http://www.sanisoft.com/ziploc/phpZipLocatorData.zip (389Kb)
Place the contents of the phpZipLocator.zip somewhere in your web document tree
Edit the file db_mysql.inc to have the proper details of the database where you
have the zipData table (you should ensure that this file is not seen from the browser)
Try accessing the ziptest.php file - you will get the following output if everything is right
=========================================
The distance between 12345 and 23456 is 433.1607605336 Miles
There are 107 Zip codes within 20 Miles of 12345
=========================================
See comments in phpZipLocator.php for the methods
See ziptest.php for sample usage.
See http://distance-calculation.com/Distance-Calculation.asp for a nice article on
distance calculation and try and figure out (im)precise phpZipLocator is ;-)
--
|