Your first line is wrong. Fix it by replacing it by
$action = isset($_GET["action"]) ? $_GET["action"] : 'form';
or you could even improve it by taking
$action = ( isset($_GET["action"]) && !empty($_GET["action"]) ) ? $_GET["action"] : 'form';
or even better (as Ben D suggested)
$action = !empty($_GET["action"]) ? $_GET["action"] : 'form';