erm ... undefined index pretty much explains the error. Undefined indexs refer to when you are attempting a access an element of a collection that does not exist, the fact that its throwing 'action' as the undefined index should pretty much tell you whats gone wrong.
Its being caused by you trying to access action element of the $_GET array, when you have not defined an action element.
The easiest solution to this is just to check if its defined (use the isset macro) or not before you try and access it.
I must admit I'm pretty suprised you haven't worked this out
, the error message is pretty clear and consise.