public static function processSubmit() { global $con; self::getParams(); self::$userId = self::getUserId(self::$deviceId, self::$passcode); //check if user is authorized: if (self::$userId != -1) { self::addLocationToDB(); } else { self::$response_array['message'] = 'not authorized'; } echo json_encode(self::$response_array); mysql_close($con); }