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
https://forums.phpfreaks.com/topic/263201-any-ideas-will-be-grately-appreciated/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.