Notice: Undefinedindex: skuin solution in PHP. In PHP, the Notice: Undefinedindex: skuin solution is not a bug, and it is warning. when using $ _ GET [] or $ _ POST [] without isset, this error will be prompted. in Jon PHP, the Notice: Undefined index: sku in problem solution
This is not a bug, and warning, when using $ _ GET [] or $ _ POST [] without isset or other judgment, will prompt this error, jones's solution perfectly solves this problem:
/** Replace $ _ GET [] to get the value */function _ GET ($ str) {$ val =! Empty ($ _ GET [$ str])? $ _ GET [$ str]: null; return $ val;}/** replace $ _ POST [] to GET the value */function _ post ($ str) {$ val =! Empty ($ _ POST [$ str])? $ _ POST [$ str]: null; return $ val ;}
The usage is as follows:
/** Set the current page number */$ page = _ get ('page'); $ inventory-> setCurrentPage ($ page ); /** calculate the total number of pages */$ sku = _ post ('sku '); $ warehouse = _ post ('warehouse '); $ supplier = _ post ('Supplier ');
Undefined index: this is not a bug in the solution to the sku in problem, and warning, when using $ _ GET [] or $ _ POST [] without isset or other judgment, this error will be prompted, Jon...