Obecnie formularz przekazuje 1
Jaką funkcję użyć by przekazywano całość stringa czyli pełną datę?
<!DOCTYPE html> <html> <head> <script type='text/javascript'> function showDate(str) { if (str=="") { document.getElementById("txtDate").innerHTML=""; return; } 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 (this.readyState==4 && this.status==200) { document.getElementById("txtDate").innerHTML=this.responseText; } } xmlhttp.open("GET","zm.php?q="+str,true); xmlhttp.send(); } </script> </head> <body> <form> <input type="date" name="users" onchange="showDate(this.value)"> </form> <br> </body>
<?php include('baza.php'); $sql="SELECT * FROM event WHERE data = '".$q."'"; $result = mysqli_query($con,$sql); echo "<table> <tr> <th>nazwa</th> </tr>"; while($row = mysqli_fetch_array($result)) { } mysqli_close($con); ?>