</h1>  
        <table border="1">
            <tr>
            <th>Object Id</th>
            <th>Display Name</th>
            </tr>  
            <?php 
// If this is a post back, add the user to the group.
if (isset($_POST['submit'])) {
    // Validate that display name is non-empty.
    if (empty($_POST['dname'])) {
        echo '<p><b>Please provide a valid user display name for the user to be added. User display name can not be empty</b></p>';
    } else {
        // First get the object id of the user that needs to be createed to this group
        // Use the $filter syntax from OData.
        $filteredusers = GraphServiceAccessHelper::getFeedWithFilterClause('users', 'displayName', $_POST['dname']);
        // If the query did not return any members, display an error to the user.
        if (count($filteredusers) === 0) {
            echo '<p><b>Please provide a valid user display name for the user to be added. User display name:\'' . $_POST['dname'] . '\' is not valid</b></p>';
        } else {
            // We should ideally handle the case where there are multiple members with the same diplay name but let's
            // make the simple assumption that they are distinct.
            foreach ($filteredusers as $filtereduser) {
                $userid = $filtereduser->{'objectId'};
            }
            $useruri = array('url' => 'https://graph.windows.net/' . Settings::$appTenantDomainName . '/users(\'' . $userid . '\')');
            $groupUrl = "groups(" . '\'' . $_GET['id'] . '\')';
            $addedLink = GraphServiceAccessHelper::addLinkForEntries($groupUrl, $useruri, 'members');
        }
    }
}