Want to use both GET and POST methods

后端 未结 6 1393
情话喂你
情话喂你 2020-12-11 16:21

I know result page that uses GET method can be bookmarked while the one using POST cannot be. I also know about the restrictions of the GET methods.

Now suppose I w

6条回答
  •  渐次进展
    2020-12-11 16:29

    function getQVar($key){
         return isset($_GET[$key]) ? $_GET[$key] : (isset($_POST[$key]) ? $_POST[$key] : null); 
    }
    echo getQVar("name");
    

    Switch around $_GET and $_POST to prioritize POST over GET vars.

提交回复
热议问题