-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$delimiter = $_SESSION['delimiter'];
-$onetimepad = $_SESSION['onetimepad'];
-$QUERY_STRING = $_SERVER['QUERY_STRING'];
-sqextractGlobalVar('messages');
+sqgetGlobalVar('messages', $messages, SQ_SESSION);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
+sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET);
+sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);