Compare with Previous | Blame | View Log
<?
/**
* PEICivicAddressLookup.php - A PHP and AJAX-driven Prince Edward Island
* civic address lookup script.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the 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 GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* @version 0.1, November 7, 2005
* @link http://ruk.ca/wiki/PEI_Civic_Address_Lookup_with_AJAX
* @author Peter Rukavina <peter@rukavina.net>
* @copyright Reinvented Inc., 2005
* @license http://www.fsf.org/licensing/licenses/gpl.txt GNU Public License
*/
//---------------------------------------
// User Configurable Settings
//---------------------------------------
$JAVASCRIPT = "/civicaddress/javascript"; // Location of the script.aculo.us JavaScript classes
$LOOKUPSCRIPT = "/civicaddress/PEICivicAddressLookupAJAX.php"; // Location of the companion AJAX lookup script
//---------------------------------------
// End of User Configurable Settings
//---------------------------------------
?>
<head>
<title>Civic Address Lookup Test</title>
<!-- Grab these JavaScript classes from http://script.aculo.us/
and install under /javascript/ on your server. -->
<script src="<? echo $JAVASCRIPT; ?>/prototype.js" type="text/javascript"></script>
<script src="<? echo $JAVASCRIPT; ?>/effects.js" type="text/javascript"></script>
<script src="<? echo $JAVASCRIPT; ?>/dragdrop.js" type="text/javascript"></script>
<script src="<? echo $JAVASCRIPT; ?>/controls.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="PEICivicAddressLookup.css">
</head>
<body>
<center>
<form action="lookup.php" name="CivicAddressForm">
<h1>Type your Civic Address</h1>
<h2>Matching addresses appear as you type. Click an address to select.</h2>
<p style="margin: 4px 0 0 0;">
<input autocomplete="off" id="civicaddress" name="civicaddress" size="40" type="text" value="" style="background: #ffffdd;" />
<input type=submit value="Lookup">
<div class="auto_complete" id="address_auto_complete"></div>
</p>
</form>
<script type="text/javascript">
new Ajax.Autocompleter('civicaddress', 'address_auto_complete','<? echo $LOOKUPSCRIPT; ?>', { minChars: 1, frequency: 0.15 })
document.CivicAddressForm.civicaddress.focus();
</script>
</center>
</body>