Php import_request_variable stopped working

前端 未结 2 823
隐瞒了意图╮
隐瞒了意图╮ 2020-12-22 00:05

Hey everyone I was getting the following error on my web page:

Fatal error: Call to undefined function import_request_variables() in /demo/conn.php on line 5         


        
2条回答
  •  独厮守ぢ
    2020-12-22 00:26

    I wrote this replacement. It works for me. I hope it helps you. for example this URL : test.php?z=1

    import_request_variables("gp",'abc_');
    echo $abc_z; // 1
    function import_request_variables($g,$prfix)
    {
        foreach($_GET as $k => $v)
        {
            $v_name = $prfix.$k;
            global $$v_name;
            ${$prfix.$k} = $v;
        }
        foreach($_POST as $k => $v)
        {
            $v_name = $prfix.$k;
            global $$v_name;
            ${$prfix.$k} = $v;
        }
    }
    

提交回复
热议问题