You could check with isset
like
if (isset($_GET['errormsg']) && $_GET['errormsg'] == 'no_appid') {
$_SESSION['errormsg'] = "There was a problem with your application. Please reenter all data.";
}
look at php isset
4
solved How to fix Undefined Index warnings? [duplicate]