Have a look here This is my chat page, it all done in PERL, if the user is registered on my board it automatically sets there chat nick to the one they are registered with and puts them in the chat room, otherwise it lists them as a guest. Also it logs that the user is in the chat room on my who's online page.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.