Why do I need the isset() function in php?

后端 未结 6 1685
终归单人心
终归单人心 2021-01-04 06:27

I am trying to understand the difference between this:

if (isset($_POST[\'Submit\'])) { 
  //do something
}

and

if ($_POST[         


        
6条回答
  •  既然无缘
    2021-01-04 07:14

    The code

    
    if($_POST['Submit'])
    {
    //some code
    }
    
    

    will not work in WAMP (works on xampp)
    on WAMP you will have to use

    
    if (isset($_POST['Submit'])) { 
      //do something
    }
    
    

    try it. :)

提交回复
热议问题