How do i limit the user registration in the registration page? i want to limit the user that can register to only 2 users. and if another user want to register, they will have a notice "Registration is Full".
Help me, i dont know what to do now, im looking for the answer for the whole week.
here's the php code of the registration process,
<?php
include('connection.php');
$name=$_POST['name'];
$username=$_POST['username'];
$password=$_POST['password'];
$password2=$_POST['password2'];
$sql=mysqli_query($conn,"INSERT INTO admin (name,username,password,password2) VALUES ('$name','$username','$password','$password2')");
if($sql == TRUE)
{
echo '<script language="javascript">';
echo 'alert("Register Successfully");';
echo 'window.location.href="index_admin.php";';
echo'</script>';
}
else
{
echo "Error: ".$sql."<br>".$conn -> error;
}
$conn -> close();
?>