ref = document.referrer;
$.post('ref.php', {ref: ref});
