$id=$_POST['id'];
欢彤
欢彤 2017-07-23 17:12:08
0
6
2422

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

欢彤
欢彤

reply all(6)
Here I am

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

立伟

Check whether

$_POST['id']

exists

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

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

蝎子

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

Ailon

Please post the error message

Ty80

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template