I've reducded the php in the file down to one include but am still getting this error message:
[15-Dec-2009 23:48:54] PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\file_resource\php\find.php on line 26
Full Code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ASKFHAFK7DlJuFhx2QQLPMOOwqbU2dfvbHPRyx4R87tPWtgr_ht1v42FIxQ8Nv1ZKoPLBF-B1MSToqBoZy2817Q" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var geocoder;
var map;
var location2;
function showLocation() {
map = new GMap2(document.getElementById("map"));
geocoder = new GClientGeocoder();
geocoder.getLocations(document.forms[0].address2.value, function (response) {
if (!response || response.Status.code != 200)
{
alert("Sorry, we were unable to geocode the second address");
}
else
{
location2 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address};
calculateDistance();
}
});
}
function calculateDistance()
{
try
{
var endlocation = new GLatLng(location2.lat, location2.lon);
marker = new GMarker(endlocation);
// Add the marker to map
map.clearOverlays();
map.addOverlay(marker);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
var bounds = new GLatLngBounds();
bounds.extend(endlocation);
map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
// highlightCurrentMarker();
document.getElementById('results').innerHTML = 'Location Found. <a href="find.php?address=' + endlocation + '">Click here to search.</a>';
}
catch (error)
{
alert(error);
}
}
//]]>
</script>
<link rel="stylesheet" type="text/css" media="screen" href="find.css" />
</head>
<body onunload="GUnload()">
<?php
include('menu.php');
?>
<div class="float">
<h1>Find an Address</h1>
<form action="#" onsubmit="showLocation(); return false;">
<input type="text" name="address2" value="Find Location" class="address_input" />
<input type="submit" name="find" value="Search" />
</form>
<p id="results"></p>
</div>
<div id="map"></div>
</body>
</html>
I'm assuming this means it is in the menu.php?
Bookmarks