subhomoy Posted May 27, 2012 Share Posted May 27, 2012 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... Quote Link to comment https://forums.phpfreaks.com/topic/263201-any-ideas-will-be-grately-appreciated/ Share on other sites More sharing options...
DanWhite Posted May 28, 2012 Share Posted May 28, 2012 What does it do? Nothing, or is there an error message? Quote Link to comment https://forums.phpfreaks.com/topic/263201-any-ideas-will-be-grately-appreciated/#findComment-1349362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.