if (!empty($_POST)) not working

前端 未结 6 1866
悲哀的现实
悲哀的现实 2020-12-18 09:28

I have a php form (code to follow) with a submit button that runs JSON-events.php as its action (method = POST). In the JSON-events co

6条回答
  •  自闭症患者
    2020-12-18 10:03

    Conditions that you can use with $_POST

    if(count($_POST)>0){
        //...
    }
    if(isset($_POST['field_name'])){
        //...
    }
    if( $_SERVER['REQUEST_METHOD'] == 'POST') {
        //..
    }
    

提交回复
热议问题