View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12831 Members
Join this group to post and comment.
gijoe
gijoe • Oct 11, 2008

ajax doubt




Name: Time:
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
sriramchandrk
sriramchandrk • Oct 14, 2008
Hi gijoe,

This is the line which reads value of name in y
var y=document.myform.na.value;

When you click a submit ajaxfunction is called.

if you write "crazyengineer" in input filed the url formed will be


https://servername/time.php?q=crazyengineer&sid=8948923

sid will have a random number this is just to take care that each time a new url is produced or else there may be a possibility that browser cache will give old values!

Thanks & Regards
Sriram

Share this content on your social channels -