How do you track referrals?

Issue:
How do you track referrals?

=0){retval+=theval.substring(0,theval.indexOf(findvar));retval+=repvar;theval=theval.substring(th