PHPZipLocator problem!
Posted: Fri Jun 02, 2006 11:49 pm
arborint | Please use
dont know what need to be change. Thank you for any help.
arborint | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello everyone.
I am begginer in PHP, but need to create simple ZIP CODE DISTANCE Application....
I found on Google FREE PHPZipLocator. It includes Class Locator, function distance and SQL file with zipcodes.
There is one file ziptest which I think need to be change.....I created HTML form with table like this:Code: Select all
<form name="form1" method="post" action="">
<table width="467" height="143" border="0">
<tr>
<td width="152">Enter ZIP_CODE nr 1: </td>
<td width="299"><input name="zipOne" type="text" id="zipOne" size="10" maxlength="5"></td>
</tr>
<tr>
<td>Enter ZIP_CODE nr 2: </td>
<td><input name="zipTwo" type="text" id="zipTwo" size="10" maxlength="5"></td>
</tr>
<tr>
<td> </td>
<td><input name="submmit" type="submit" id="submmit" value="Calculate distance"></td>
</tr>
<tr>
<td colspan="2">Distance between two Zip_Codes is:
<input name="distance" type="text" id="distance" size="15">
miles. </td>
</tr>
</table>
</form>
I dont know what to change in PHP part..........Oryginall code was like this:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | Filname: |
// +----------------------------------------------------------------------+
// | Copyright (c) http://www.sanisoft.com |
// +----------------------------------------------------------------------+
// | Description: |
// +----------------------------------------------------------------------+
// | Authors: Original Author <author@example.com> |
// | Your Name <you@example.com> |
// +----------------------------------------------------------------------+
//
// $Id$
include_once ("db_mysql.inc");
include_once ("phpZipLocator.php");
$db = new db_sql;
$zipLoc = new zipLocator;
$zipOne = 12345;
$zipTwo = 23456;
$distance = $zipLoc->distance($zipOne,$zipTwo);
echo "The distance between $zipOne and $zipTwo is $distance Miles<br>";
$radius = 20;
$zipArray = $zipLoc->inradius($zipOne,$radius);
echo "There are ",count($zipArray)." Zip codes within $radius Miles of $zipOne";
?>arborint | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]