Access a JavaScript variable from PHP

后端 未结 8 952
萌比男神i
萌比男神i 2020-11-22 11:47

I need to access a JavaScript variable with PHP. Here\'s a stripped-down version of the code I\'m currently trying, which isn\'t working:

8条回答
  •  感情败类
    2020-11-22 12:11

    JS ist browser-based, PHP is server-based. You have to generate some browser-based request/signal to get the data from the JS into the PHP. Take a look into Ajax.

提交回复
热议问题