unistake Posted September 4, 2009 Share Posted September 4, 2009 Hi all, Does anyone know how to send Javascript variables to a mysql database? If someone can give me an example that would be great. I am using PHP on the same page if that can be used also?... Thanks for the help Tim Quote Link to comment Share on other sites More sharing options...
ldb358 Posted September 5, 2009 Share Posted September 5, 2009 i think your looking for is ajax Quote Link to comment Share on other sites More sharing options...
mrwutang Posted September 5, 2009 Share Posted September 5, 2009 Okay lemme see if I got this right, you want to pass your javascript values to php? Im kinda new to php so Ill tell you what I know. An easier way would be to use get method. For eg, if you want to pass the value of var variable='somethin' to php try. document.location='website.com/code.php?var='+variable; Or use an iframe or popup window to pass the value along.And set your php code to$_GET the variable. $varible=$_GET['var'];and use it to pass the value to mysql. Theres a more complex way to do this too, if you wanna use POST method.Using ajax. Lemme know if you wanna know that. Ill give you the code. I can tell you more if you tell me more about your code. What do you want to do with this variable? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.