来自php的ajax请求xml

I Have a google Map, which gets markers loaded based on a date variable, in the PHP. The default date is current date. Now I want the date to be changeable, through a form. On the page where the map is, I have a form, where users can select a date, and I want the map to reload markers based on the date selected. I have an onChange event call the mytest(); function, which will re-load the map. I can't get it to work, when the date is changed, nothing happens. Here is my code.

JavaScript

    function mytest() {


var map = ''

function MyMap(){


    var im = 'http://www.robotwoods.com/dev/misc/bluecircle.png';
    var CustomMarker = 'http://findmyyard.com/images/MarkerIcon.png';


    if(navigator.geolocation){

        navigator.geolocation.getCurrentPosition(locate);
    } else { 

   alert('Please enable "Location Sharing"')

    }

    function locate(position){

        var myLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
        var mapOptions = {
          zoom: 12,
          center: myLatLng,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          zoomControl: true,
          streetViewControl: false,
        }
        var map = new google.maps.Map(document.getElementById('map-canvas'),
                                      mapOptions);
        var userMarker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            icon: im
        });
    var infoWindow = new google.maps.InfoWindow;

    var date = document.getElementById('finddate').value;
      // Change this depending on the name of your PHP file

        downloadUrl("phps/xmltest.php"+ date, function(data) {
        var xml = data.responseXML;         
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i < markers.length; i++) {
          var name = markers[i].getAttribute("name");
          var address = markers[i].getAttribute("address");
          var dt1 = markers[i].getAttribute("date1");
          var dt2 = markers[i].getAttribute("date2");
          var dt3 = markers[i].getAttribute("date3");
          var tm1 = markers[i].getAttribute("time1");
          var tm2 = markers[i].getAttribute("time2");
          var tm3 = markers[i].getAttribute("time3");
          var html = "<b>" + name + "</b> <br/>" + "Date of Yard Sale: " + dt1 + '&nbsp;' + tm1 + '&nbsp;' + dt2 + '&nbsp;' + tm2 + '&nbsp;' + dt3 + '&nbsp;' + tm3 + '&nbsp;' + "<br/>" + address;
          var point = new google.maps.LatLng(
              parseFloat(markers[i].getAttribute("lat")),
              parseFloat(markers[i].getAttribute("lng")));
          var marker = new google.maps.Marker({
            map: map,
            position: point,
            icon: CustomMarker
          });

          bindInfoWindow(marker, map, infoWindow, html);
        }


       });


    function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent(html);
        infoWindow.open(map, marker, html);
      });
    }

    function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;

      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          request.onreadystatechange = doNothing;
          callback(request, request.status);
        }
      };

         request.open('GET',url, true);
      request.send(null);
    }
         function doNothing() {}
    }

}}

PHP - xmltest.php

<?php



       $date = $_GET['date'];

         if($date == "''" || $date == "Today") { $date = date('m-d-Y');} else {$date = $_GET['date'];}




$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);

// Opens a connection to a MySQL server

mysql_connect("localhost", "someuser", "somepw");

// Set the active MySQL database

$db_selected = mysql_select_db("Registration2");
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table



$query = "SELECT * FROM REGISTERED2 WHERE DateONE = '$date' or DateTWO = '$date' or DateTHREE = '$date'";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Iterate through the rows, adding XML nodes for each

while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  $node = $dom->createElement("marker");
  $newnode = $parnode->appendChild($node);
  $newnode->setAttribute("name",$row['Name']);
  $newnode->setAttribute("address", $row['Address']);
  $newnode->setAttribute("lat", $row['Latitude']);
  $newnode->setAttribute("lng", $row['Longitude']);
  $newnode->setAttribute("date1", $row['DateONE']);
  $newnode->setAttribute("date2", $row['DateTWO']);
  $newnode->setAttribute("date3", $row['DateTHREE']);
  $newnode->setAttribute("time1", $row['TimeONE']);
  $newnode->setAttribute("time2", $row['TimeTWO']);
  $newnode->setAttribute("time3", $row['TimeTHREE']);

}

echo $dom->saveXML();

?>

Please help me out and let me know what I'm doing wrong.

All I needed to do was change the name of var "Date" to something else.