IsAuthorized()) { $userID = $USER->GetID(); echo "User ID is: " . $userID; } else { echo "You must be logged in to see this content"; } ?>
This code uses the Bitrix library's UserTable to retrieve information about the user whose ID is returned by CUser GetID. In this example, the user's name is retrieved and displayed on the page. Package library: Bitrix