liamoco Posted October 18, 2010 Share Posted October 18, 2010 I am trying to get a JavaScript variable into a PHP variable, I can do this the other way around using the hidden input method and using something like var phpvar = document.getElementById('qwerty').value; to grab the PHP variable from within it. My problem is getting a JavaScript variable into a PHP variable, what methods are out there? Thanks Link to comment https://forums.phpfreaks.com/topic/216203-javascript-and-php-variables/ Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2010 Share Posted October 18, 2010 if using a form, you can set the value of a form field via javascript and PHP will get it on submit. then there's ajax, allowing browser-to-server communication via javascript/php. Link to comment https://forums.phpfreaks.com/topic/216203-javascript-and-php-variables/#findComment-1123627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.