search

Home  >  Q&A  >  body text

$id=$_POST['id'];

Why is it always written like this in the editor! No., when running, it always says that it is not defined

欢彤欢彤2759 days ago2452

reply all(6)I'll reply

  • Here I am

    Here I am2018-07-27 22:14:49

    I feel that there is no id in add.html, so I feel that that line of code can be omitted.

    reply
    0
  • 立伟

    立伟2017-07-26 15:53:27

    Check whether

    $_POST['id']

    exists

    reply
    0
  • nearest

    nearest2017-07-25 11:44:32

    if(isset($_POST['id']){
    $id=$_POST['id'];
    }

    First determine whether $_POST['id'] exists before using it

    reply
    0
  • 蝎子

    蝎子2017-07-24 10:51:33

    If there is no value in the post, of course it is undefined. If you use a from form to submit to a page and receive the id value, it will not be reported as undefined

    reply
    0
  • Ailon

    Ailon2017-07-24 10:38:07

    Please post the error message

    reply
    0
  • PHP中文网

    PHP中文网2017-07-24 09:09:00

    You can block warning level errors. Some versions of PHP will prompt warning errors that POST parameters do not exist. Officially launched to block non-fatal errors.

    reply
    0
  • Cancelreply