how to assign javascript variable value to php variable

前端 未结 8 1564
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 15:12

I have declared a javascript variable ,

 var myJavascriptVar = 12345;

And unable to assign that value to php variable;

8条回答
  •  甜味超标
    2020-11-28 16:00

    I guess you can use cookies for it.

    1) First add a cookie jquery plugin.

    2) Then store that window width in a cookie variable.

    3) Access your cookie in PHP like $_COOKIE['variable name'].

    http://www.w3schools.com/php/php_cookies.asp

提交回复
热议问题