PHP error: Notice: Undefined index:

后端 未结 14 1580

I am working on a shopping cart in PHP and I seem to be getting this error \"Notice: Undefined index:\" in all sorts of places. The error refers to the similar bit of coding

14条回答
  •  情书的邮戳
    2020-12-03 16:06

    How I can get rid of it so it doesnt display it?

    People here are trying to tell you that it's unprofessional (and it is), but in your case you should simply add following to the start of your application:

     error_reporting(E_ERROR|E_WARNING);
    

    This will disable E_NOTICE reporting. E_NOTICES are not errors, but notices, as the name says. You'd better check this stuff out and proof that undefined variables don't lead to errors. But the common case is that they are just informal, and perfectly normal for handling form input with PHP.

    Also, next time Google the error message first.

提交回复
热议问题