Jump to content

Any ideas will be grately appreciated...


subhomoy

Recommended Posts

Hi want to create a referral site and i want the site to work like this. when ever some one referrers anyone, he will earn some money in his account balance....

I have done the registration page with referral link and it works fine but the money part is not working..

// If it has introduced a referer see that there

if ($_POST["referer"] != "") {


$referer = securedata($_SESSION["r"]);
$referer=limitatexto($referer,15);

$checkref = mysql_query("SELECT username FROM tb_users WHERE username='$referer'");
$referer_exist = mysql_num_rows($checkref);


if ($referer_exist>0) {
// If everything seems fine proceed with the insertion
      $sqlz = "SELECT * FROM tb_users WHERE username='$referer'";
      $resultz = mysql_query($sqlz);        
      $myrowz = mysql_fetch_array($resultz);

$numero=$myrowz["referals"];

      $sqlex = "UPDATE tb_users SET referals='$numero'+1 WHERE username='$referer'";
      $resultex = mysql_query($sqlex);
}

}
// If everything looks OK proceed with the insertion

$joindate=time();

$query = "INSERT INTO tb_users (username, password, ip, email, pemail, referer, country, joindate, money,visits) VALUES('$username','$password','$laip','$email','$pemail','$referer','$country','$joindate', '0.05', '0')";
mysql_query($query) or die(mysql_error());

echo "You have been registered correctly <b>$username</b>. Now you can <a href=\"login.php\">login</a>.";
?>

 

can any one help me with it...

Thanks in advance...

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.