开发者

Best way to store referrer?

开发者 https://www.devze.com 2023-03-28 20:46 出处:网络
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.

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

精彩评论

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