を使用して、2ページ目に値を渡すためにはどのようなオプションがデータベースから来ているのJavascript AJAX
<pre>
$query = mysql_query("select * from results");
echo "<select id='date' onchange='showdata()' class='form-control'>";
while ($arr = mysql_fetch_array($query)) {
echo "<option value=".$arr['month'].">".$arr['month']."/".$arr['year']. "</option>" ;
}
echo "</select>";
</pre>
HTMLが私のページで選択しています。私はそれがHTMLで選択した値を送りたい私はアヤックススクリプト
<script>
function showdata() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", "result.php", true);
xhttp.send();
}
</script>
を持って、この後のページresult.phpに選択
あなたがここでの問題を持って、異なる年のすべての月は 'SELECT'で同じ値になります。 – jeroen