Location: PHPKode > scripts > Zip2Map, map your zip code > zip2map/getMap.php
<?php require_once('Connections/conn.php'); ?><?php
$colname_getMap = "-1";
if (isset($_GET['zipCode'])) {
  $colname_getMap = (get_magic_quotes_gpc()) ? $_GET['zipCode'] : addslashes($_GET['zipCode']);
}
mysql_select_db($database_conn, $conn);
$query_getMap = sprintf("SELECT * FROM zip_codes WHERE zip = '%s'", $colname_getMap);
$getMap = mysql_query($query_getMap, $conn) or die(mysql_error());
$row_getMap = mysql_fetch_assoc($getMap);
$totalRows_getMap = mysql_num_rows($getMap);
?><?php if ($totalRows_getMap > 0) { // Show if recordset not empty ?>
<?php echo $row_getMap['latitude']; ?>,<?php echo $row_getMap['longitude']; ?>,<?php echo $row_getMap['city']; ?>,<?php echo $row_getMap['state']; ?>,<?php echo $row_getMap['full_state']; ?>
<?php } // Show if recordset not empty
else
{
 ?>-1<?
 }
 ?><?php
mysql_free_result($getMap);
?>
Return current item: Zip2Map, map your zip code