MLM(Multi Level Marketing) Website Using PHP - Binary Plan

Part 16(B) - Join User

In the last chapter, we forgot to take two other important input box that is under_userid and side. New user will join under the under_userid and the side(left or right).

In this chapter and all the part of chapter 16, we will do some task step by step. For this chapter, the task is to check the valid pin.

Check Valid Pin

  • Create a function pin_check($pin) that will take one variable that is a pin.
  • Check if this pin is available.
  • Then the owner of this pin should be the logged user.
  • And the final condition is that the status of the pin should be open. So that every pin can use only once.


Function check_pin($pin)

function pin_check($pin){
	global $con,$userid;
	
	$query =mysqli_query($con,"select * from pin_list where pin='$pin' and userid='$userid' and status='open'");
	if(mysqli_num_rows($query)>0){
		return true;
	}
	else{
		return false;
	}
}                        


1520