Copy link to clipboard
Copied
Hi,
My php (development) website code now all works as it should, and tests on the database are all producing the correct results, however after setting error_reporting to show all errors I have several instances of :
Notice: undefined constant...
Notice: undefined variable...
Notice: undefined index...
I am aware that I can set error_reporting to not display any notices however my concern is that my code is secure.
How important are these notices with regards to a secure php website? any information would be greatly appreciated, I don't want to ignore any important security issues before going live.
Thank you in advance for your time.
Those are good to get rid of. Show All isn't normally what's shown, but those errors mean that you have not tested whether or not the variables are set ( php isset - http://php.net/manual/en/function.isset.php ). It's always good when writing scripts to make sure the variables are set before trying to use them in code. Just a simple:
if ( isset( $var ) )
will do the trick.
Copy link to clipboard
Copied
Those are good to get rid of. Show All isn't normally what's shown, but those errors mean that you have not tested whether or not the variables are set ( php isset - http://php.net/manual/en/function.isset.php ). It's always good when writing scripts to make sure the variables are set before trying to use them in code. Just a simple:
if ( isset( $var ) )
will do the trick.
Copy link to clipboard
Copied
Thank you SnakEyez02, working through my code now correcting.