You should always check that a variable exists before using its value, using [man]isset[/man] or [man]empty[/man]. If it doesn't exist you can either skip that bit of code, or create the variable with some default value, depending on which is appropriate.
if(isset($foo))
{ // do stuff with $foo
}
if(!isset($foo))
$foo = 0;
//do stuff with $foo