Best way to store referrer?
I have a site with thousands of users. Each user have an unique ID, that they can share with their friends, and in that way get referrals.
What w开发者_如何学JAVAould you recommend the best way to store the $_GET['referral']; from the URL?
Unique referral IDs should be stored in a database.
For the duration of a user's session, you can store the ID in his session like this:
session_start();
$_SESSION['referral_id'] = $_GET['referral'];
精彩评论