Can passing username via affiliate sub ID be accomplished w/PHP?

I have a Joomla website that has a member login system and a plug in that allows a me to enter "{mgetusrname}" to retrieve a user name when logged in.

What I am trying to accomplish is using Sub ID's to track info through my advertising. Could this be accomplished with a PHP script?

There's a ton of software that seems like it may do this plus a million other things that I don't need (and can't afford!). I just want the information for members who have completed offers.

Can this be done? And could it be done by someone with almost no PHP knowledge?