Where is this going to go? In a phpbox? And, basically, what you want is to make a link so that the user can access his or her own profile.
Anyway, what you want is the variable $ID_MEMBER, and you have to set it as global. To print a link to the user's profile, use
global $scripturl, $ID_MEMBER;
echo '<a href="' . $scripturl . '?action=profile;u=' . $ID_MEMBER . '">Profile</a>';