Congrats on posting your first snippet. The only thing I can say is the if ($nick==$nick) statement is really not necessary. It will always return true. If you are going to build further on this snippet, you may want to consider what happens if alot of users join at once or a server reset. You might flood out.