Page 1 of 1

Help:Need a simple php referral code

Posted: Fri Mar 04, 2011 12:01 am
by Arvkalyan
I am creating a simple website and i need a simple code for user referral (user can refer his friends and if his friend is registered he get some points for it )
and also it must be entered in the databases...


help me friends....thanx in advance

Re: Help:Need a simple php referral code

Posted: Fri Mar 04, 2011 11:23 am
by danwguy
I would say make an array and select a random amount of picks from it, then store that in the database as the referral code. Or you could do something like this...

Code: Select all

$num = range(1, 100);
$rand = array_rand($num, 5);
You now have 5 random numbers between 1 and 100, you can store $rand in the database as referral code and use it however you want.