anton578 Posted September 24, 2008 Share Posted September 24, 2008 is there a way to pass javascript array variable to php variable without reloading the page? Quote Link to comment Share on other sites More sharing options...
xtopolis Posted September 24, 2008 Share Posted September 24, 2008 Yes and no. Yes you can pass a var to php, using AJAX, and it doesn't have to reload the page, but it won't change anything on the page unless you tell it to... No, are you sure the purpose of this is logically correct? Explain what you're trying to do... Quote Link to comment Share on other sites More sharing options...
anton578 Posted September 24, 2008 Author Share Posted September 24, 2008 Yes and no. Yes you can pass a var to php, using AJAX, and it doesn't have to reload the page, but it won't change anything on the page unless you tell it to... No, are you sure the purpose of this is logically correct? Explain what you're trying to do... thanks for the reply... im sorry im new to this can you give me an example of ajax on how to pass variable without reloading page... my purpose is im gonna need that javascript variable to be a php variable so i can use that variable for my php script... Quote Link to comment Share on other sites More sharing options...
xtopolis Posted September 24, 2008 Share Posted September 24, 2008 If you're submitting a form, set the javascript value to a hidden field <script type="text/javascript"> document.write('<input type="hidden" name="fromJS" value="'+ myVal +'">'); </script> Otherwise, please visit the ajax board, there are links for tutorials there, or they are searchable online. Quote Link to comment Share on other sites More sharing options...
anton578 Posted September 24, 2008 Author Share Posted September 24, 2008 ok thanks for the help... 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.