ajax doubt
<html> <body> <script type="text/javascript"> function ajaxfunction() { var y=document.myform.na.value; var z=document.myform.time.value; var x; try { x=new XMLHttpRequest(); } catch(e) { try { x=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { x=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX :("); return false; } } } x.onreadystatechange=function() { if(x.readyState==4) { document.myform.time.value=x.responseText; } } var url="time.php"; url=url + "?q=" + y ; url=url + "&sid =" + Math.random(); x.open("GET", url , true); x.send(null); } </script> <form name="myform"> Name: <input type="text" name="na"/> Time: <input type="text" name="time"/> <input type="button" onclick="ajaxfunction();" name="btn"> </form> </body> </html>this is jus a prog in ajax to check if the username and password are correct???
i jus don get the three lines below:
var url="time.php";
url=url + "?q=" + y ;
url=url + "&sid =" + Math.random();
x.open("GET", url , true);
x.send(null);
how is q assigned the correct value??? of y and wht ll be the variable url while sending??
also i need to attach one more value to the url, it is z here..
in the php code, the stmt
$n=$_GET["q"];
exactly retrieves the value of q and assigns it to n...
so jus say what does that ? and = mean and how they are assigned
thnx in advance
0