Is you are testing a variable you should always use [man]isset[/man] first especially in distribution scripts where you don't control the user's environment.
If you are testing an array key you should always use [man]array_key_exists[/man] first, especially in distribution script where you don't control the user's environment.
Just put error_reporting(E_ALL) at the top of your script and work on it until all the errors, warnings and notices go away. Then you've got a script that is ready for distribution.