This begs a much clearer explanation... what server-side scripting languages does your host support, that you are familiar with? And how are you planning to give the referring website credit?
This kind of thing is rather easy to do... if you have mastered the (bare bones) basics of HTML, CSS, JavaScript, etc. then I'd recommend a database tutorial...:
http://www.webmonkey.com
... and look up their database tutorials (under "backend programming").
But at the least you should look up some references to
document.referrer in javascript. However, you can't store anything in javascript (except on the user's computer in a cookie, IF they have cookies enabled!).
Don't worry - take the tutorials. They are really very user-friendly, and you don't have to be a genius to use databases. If you want evidence, I'll send you my picture.