something is wrong here… formatting i think a ” or some **** but i’ve spent hours going over this time and time agian its gonna smack me in the damn face i know it… but can someone point out what the hell i’ve done wrong???
my code
[CODE]<?php
session_start();
$froma = $_SESSION[‘froma’];
$dropoff = $_SESSION[‘dropoff’];
unset($_SESSION[‘froma’]);
unset($_SESSION[‘dropoff’]);
session_destroy();
print(“<html><head>”);
print(“<script src=”http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAKBQCMjjfKSlhfW56Px_BxhSkc0RhBuv0oL0fIKsBsOMFMKMHUBSTswp2ETs99XXTFGeCud1cJwVTtg” type=”text/javascript”></script>”);
print(“<script type=”text/javascript”>”);
print(“var map;”);
print(“var gdir;”);
print(“var geocoder = null;”);
print(“var addressMarker;”);
print(“function initialize() {“);
print(“if (GBrowserIsCompatible()) {“);
print(“map = new GMap2(document.getElementById(“map_canvas”));”);
print(“gdir = new GDirections(map, document.getElementById(“directions”));”);
print(“GEvent.addListener(gdir, “load”, onGDirectionsLoad);”);
print(“GEvent.addListener(gdir, “error”, handleErrors);”);
print(“map.setCenter(new GLatLng(35.595344, -80.906754), 10);”);
print(“}”);
print(“}”);
print(“function setDirections(fromAddress, toAddress) {“);
print(“gdir.load(“from: ” + $froma + ” to: ” + $dropoff);”);
print(“}”);
print(“function onGDirectionsLoad(){ var passengers = document.formfares.Passengers.value;”);
print(“var miles = gdir.getDistance().meters/1609.344;”);
print(“var fifthmiles = Math.ceil(miles/.2);”);
print(“var persons = 0;”);
print(“var fare = 0;”);
print(“if(passengers > 2) {persons = (passengers – 2) * 2};”);
print(“fare = 2.0 + (fifthmiles * .4) + persons;”);
print(“document.getElementById(“output”).innerHTML = “Your estimated taxi fare is: $”+fare.toFixed(2);”);
print(“}”);
print(“function handleErrors(){“);
print(“if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)”);
print(“alert(“No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.nError code: ” + gdir.getStatus().code);”);
print(“else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)”);
print(“alert(“A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.n Error code: ” + gdir.getStatus().code);”);
print(“else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)”);
print(“alert(“The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.n Error code: ” + gdir.getStatus().code);”);
print(“else if (gdir.getStatus().code == G_GEO_BAD_KEY)”);
print(“alert(“The given key is either invalid or does not match the domain for which it was given. n Error code: ” + gdir.getStatus().code);”);
print(“else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)”);
print(“alert(“A directions request could not be successfully parsed.n Error code: ” + gdir.getStatus().code);”);
print(“else alert(“An unknown error occurred.”);”);
print(“}”);
print(“</script>”);
print(“</head>”);
print(“<body onload=”initialize() ; setDirections() ;”>”);
print(“<div id=”output” style=”width: 250px; height: 30px; font-size:15px”></div>”);
print(“<div id=”map_canvas” style=”width: 0px; height: 0px; POSITION:ABSOLUTE; TOP:0PX;LEFT:0PX;” align=”center”></div>”);
print(“</body>”);
print(“</html>”);
?>
the dom source from browser..
[CODE]<html><head><script src=”http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAKBQCMjjfKSlhfW56Px_BxhSkc0RhBuv0oL0fIKsBsOMFMKMHUBSTswp2ETs99XXTFGeCud1cJwVTtg” type=”text/javascript”></script><script type=”text/javascript”>var map;var gdir;var geocoder = null;var addressMarker;function initialize() {if (GBrowserIsCompatible()) {map = new GMap2(document.getElementById(“map_canvas”));gdir = new GDirections(map, document.getElementById(“directions”));GEvent.addListener(gdir, “load”, onGDirectionsLoad);GEvent.addListener(gdir, “error”, handleErrors);map.setCenter(new GLatLng(35.595344, -80.906754), 10);}}function setDirections(fromAddress, toAddress) {gdir.load(“from: ” + + ” to: ” + );}function onGDirectionsLoad(){ var passengers = document.formfares.Passengers.value;var miles = gdir.getDistance().meters/1609.344;var fifthmiles = Math.ceil(miles/.2);var persons = 0;var fare = 0;if(passengers > 2) {persons = (passengers – 2) * 2};fare = 2.0 + (fifthmiles * .4) + persons;document.getElementById(“output”).innerHTML = “Your estimated taxi fare is: $”+fare.toFixed(2);}function handleErrors(){if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)alert(“No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.
Error code: ” + gdir.getStatus().code);else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)alert(“A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.
Error code: ” + gdir.getStatus().code);else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)alert(“The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.
Error code: ” + gdir.getStatus().code);else if (gdir.getStatus().code == G_GEO_BAD_KEY)alert(“The given key is either invalid or does not match the domain for which it was given.
Error code: ” + gdir.getStatus().code);else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)alert(“A directions request could not be successfully parsed.
Error code: ” + gdir.getStatus().code);else alert(“An unknown error occurred.”);}</script></head><body onload=”initialize() ; setDirections() ;”><div id=”output” style=”width: 250px; height: 30px; font-size:15px”></div><div id=”map_canvas” style=”width: 0px; height: 0px; POSITION:ABSOLUTE; TOP:0PX;LEFT:0PX;” align=”center”></div>
print(“hello world”);
</body></html>
but nothing is being displayed on the page at all