Pass angularjs value to PHP variable

前端 未结 4 488
故里飘歌
故里飘歌 2021-01-18 14:06

I am starting with angularjs with ngStorage. I can save and display data successfully.

I display value as before

{{myobj.session}}

4条回答
  •  有刺的猬
    2021-01-18 15:06

    You can do a ajax request like this:

    $http({
            url: "urltopost.php",
            method: "POST",
            data: {
                data: variable
            }
        }).success(function(response) {
        console.log(response);
    });
    

    And on the backend you can get the variable like this

    data
    

    From there you can do everything you want with that variable, still I'm not sure what are you trying to achieve.

提交回复
热议问题