I’m trying to use the following code (“time_summary”) to send parameters to another php page (“time_summary_update”) which should run a query based on those parameters and return the data in a table. I know the other php file that runs the query works because I can manually browse to the page and see the correct results, but I want the results returned to the calling page to be displayed on the calling page. Right now the result just shows the correct parameters in the URL, but doesn’t return the data. Sorry for the formatting, but can you see a problem with the code?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="script/functions.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script>
function showDetails(d1, d2) {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("divSummary").innerHTML = xmlhttp.responseText;
}
};
xmlhttp.open("GET","time_summary_update.php?d1="+d1+"&d2="+d2+,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form name='frmSummary' id='frmSummary' method='' action=''>
<div align='center' id='dates'>Enter a Date Range:<br><br>
From:<input type='date' id='from_date' name='from_date' class='row3'>
To:<input type='date' id='to_date' name='to_date' class='row3'>
</div><br>
<div id='divSummary'>
</div><br>
<table align='center' cellpadding='0' cellspacing='0' border='0' width='1002'>
<tr><td width='1000' height='50' align='center' valign='bottom'>
<input type='submit' id='submit' name='btnSummary' class='submit'
onClick = 'showDetails(<script>document.getElementById("from_date").value;</script>,
<script>document.getElementById("to_date").value;</script>)' />
</td></tr>
</table>
</form>
</body>
</html>