How to assign JavaScript variable to PHP session variable?

前端 未结 2 1702
迷失自我
迷失自我 2021-01-27 11:55

Here\'s javascript code that i have

  var randomnum = 30;

and here\'s PHP code



        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-27 11:59

    You can't access Session directly in JavaScript.

    You can make a hidden field and pass it to your page and then use JavaScript to retrieve the object via document.getElementById

提交回复
热议问题