Hello Developers i have a task to build a referral site. The objective is to have people share a link with their friends and this link has a unique referral code so that the person join is registered as a follower attached to a client here is my sample code please help me out.
Below is the flow of the registration process
When the reg button is clicked it creates a refcode which is unique for each personal account created
After registration the person gets a link auto generated with the ref code attached which they can share by email or any other possible way
Below is the sample code
//creating reference code
$re =1;
do
{
$re++;
$refcode = "TUG_".$re;
$checkrefcode = $con->query("SELECT * FROM clients WHERE Refcode ='$refcode'")
or die (mysqli_error());
$refcode_inuse = mysqli_num_rows($checkrefcode);
}
while($refcode_inuse >0);
//generating Link
$href = "<a href="localhost/2gther/follower_reg/$refcode.php">";