Hello, I get an error when updating a category name in a script. The error that I get is $parentPosition not defined in line 523 Is there a simple way to fix it without turning off the PHP error messages?
you can check it against: if it's a constant use: if (defined($parentPosition)) { } if it's not a constant use: if (isset($parentPosition)) { }
Constants in PHP do not have the $ sign. That is not an error, but rather a notice, which is safe to hide. Add this line to the beginning of your main file (config, header, etc..) to suppress notices. error_reporting(E_ALL ^ E_NOTICE); PHP: If changing your error levels is not possible/preferred, then do what wren11 said or always predefine your variables.
This is like putting sticky tape over your car's "check engine" light. Hiding the problem doesn't fix it. This probably can be fixed properly by adding a single line of code. If you need help, please post your code.
If you are going to sell this script (this script will be used by someone else), you'd better fix it. Because sometimes on some hosting environment, PHP notice will be displayed