开发者

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'];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜