Check if request is GET or POST

后端 未结 6 1218
离开以前
离开以前 2021-02-04 23:37

In my controller/action:

if(!empty($_POST))
{
    if(Auth::attempt(Input::get(\'data\')))
    {
        return Redirect::intended();
    }
    else
    {
                


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 00:11

    $_SERVER['REQUEST_METHOD'] is used for that.

    It returns one of the following:

    • 'GET'
    • 'HEAD'
    • 'POST'
    • 'PUT'

提交回复
热议问题