PDA

View Full Version : Reading javascript variables with PHP



jit.sd
April 27th, 2009, 06:33 AM
Hey ,
I am making a page which needs to load the appropriate values from a database depending on which option is selected by the user in a drop down menu . So the option selected by the user is stored in a javascript variable , now how to i pass this value onto a php variable which will eventually connect to the mySql database and get me what i want . I do not want to leave the page or reload the page . Is there a way of doing this without loading a new page or reloading the page ?

thanks ,
Jit

Arndt
April 27th, 2009, 07:53 AM
Hey ,
I am making a page which needs to load the appropriate values from a database depending on which option is selected by the user in a drop down menu . So the option selected by the user is stored in a javascript variable , now how to i pass this value onto a php variable which will eventually connect to the mySql database and get me what i want . I do not want to leave the page or reload the page . Is there a way of doing this without loading a new page or reloading the page ?

thanks ,
Jit

I think what http://www.w3schools.com/ajax/default.asp has to say about AJAX can be helpful. And I can't say much more because I only experimented a little with this - I haven't done much Web programming.