How can I store JavaScript variable output into a PHP variable?

前端 未结 8 1139
时光取名叫无心
时光取名叫无心 2020-11-30 04:09

I have the following code in JavaScript:


PHP Code:-



        
8条回答
  •  既然无缘
    2020-11-30 05:05

    The ideal method would be to pass it with an AJAX call, but for a quick and dirty method, all you'd have to do is reload the page with this variable in a $_GET parameter -

    
    

    Your page will reload and now in your PHP, you'll have access to the $_GET['a'] variable.

    
    

提交回复
热议问题