Undefined index - PHP Notice
Hi, I have the following trouble (or annoyance)
I get these kind of errors in my php error log:
[12-Feb-2003 15:47:52] PHP Notice: Undefined index: test in tst.php on
[12-Feb-2003 15:48:22] PHP Notice: Undefined index: test in tst.php on
I know they are not harmful, but I would like to learn how to avoid them.
It's normally logged when I use these kind of statements in my code:
// do something here
It's ofcourse only when I don't send the get variable that the notice
appears. How do I avoid getting the notice messages?
I've tried stuff like this, and it works if I don't send any get
variables but if I send one or more but doesn't name them to "test" it
will still produce the notice error message.
I'm pretty sure there's some nice simple way around this so please tell
me how ;)
I know that I could change the error reporting level but that's not what
I'm looking for, I want to know how to write clean, error free code.
Thanks for any help !