garryd Posted August 31, 2007 Share Posted August 31, 2007 I need help learning how to pass a variable from javascript to php. I remember reading somewhere that it could be done using a hidden field and $_GET to retrieve the data. Any advice would be welcomed. Link to comment https://forums.phpfreaks.com/topic/67439-javascript-variables-and-php/ Share on other sites More sharing options...
Jessica Posted August 31, 2007 Share Posted August 31, 2007 Are you planning on submitting a form anyway? If so, make a hidden field and use javascript to set the value of it. Then you can get it when you POST the form. If you're not submitting a form You'll need to use AJAX. Link to comment https://forums.phpfreaks.com/topic/67439-javascript-variables-and-php/#findComment-338518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.