I believe it's already built in. The variable name is "referrer".
When you load a forum page with the referrer set in the URL, it gets copied to a cookie, then when you load the registration form, the referrer name is filled in automatically.
I just went to
http://www.ps3lounge.net/forums.php?referrer=1 and then tried to register, and your username was filled in.