How to pass value JavaScript variable to PHP?

后端 未结 4 1155
借酒劲吻你
借酒劲吻你 2021-01-22 13:38

Passing value JavaScript variable to PHP.

Example

JavaScript

Var ffffd=\'aaaa\'

PHP

<         


        
4条回答
  •  时光说笑
    2021-01-22 14:14

    I have tested the following code and it have worked. So please test this code:

    function aa()
    {
        var ffffd='aaaa';
        window.location.href="newpage.php?Result=" +ffffd;
    }
    

    click a button then will call aa() function and will go newpage.php where we get ffffd variable value in Result variable

    newpage.php:

    extract($_GET);
    echo $Result;
    

提交回复
热议问题