The two php scripts are completely separate, so you can't just set $aaa in one and use it in another. Probably you want to do something like pass it as a parameter, like:
Code:
<iframe id="livechat" frameborder="0" width="100%" height="900" allowtransparency="true" marginwidth="0" marginheight="0" src="http://www.mydomain.com/mypage.php?username={vb:var bbuserinfo.username}&userid={vb:raw bbuserinfo.userid}"></iframe>