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

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

I have the following code in JavaScript:


PHP Code:-



        
8条回答
  •  离开以前
    2020-11-30 05:03

    You really can't. PHP is generated at the server then sent to the browser, where JS starts to do it's stuff. So, whatever happens in JS on a page, PHP doesn't know because it's already done it's stuff. @manjula is correct, that if you want that to happen, you'd have to use a POST, or an ajax.

提交回复
热议问题