Very easy.
Create a database with 2 tables. One has your referring people, each with his own unique code (though you could just use their id/primary key as the code), plus any other information you want (name, business name, business website, etc)
Second table has 4 fields: id, date, url, referrer
Referrer's add their code to the urls as variable in the query string:
http://www.domain.com/page.php?ref=4d99ad3
where 4d99ad3 is their special code.
Then you can either include as a seperate page, or include as a function, something along the lines below:
check to see if $GET['ref'] is set. If it is, then insert a row into the database with the current unix timestamp, their code, and the url ($SERVER['PHP_SELF']).