title: Setting limit for registration?
body: <p>As i already tried but nodbody helped me i will try it again. I want to set a limit to 16 for people who want to register with this script can please somebody edit MY script and post it here so that i can copy paste it couse im pretty bad in coding so before i try around and get always an error plz somebody just simply post my code with the limt 16. Thank you guys it would be so great if someone do it </p>
  
  <p>here is the script</p>
  
  <pre><code>&lt;?php
  $error_message = "";
  if ($_SERVER['REQUEST_METHOD'] == 'POST')
  {
     $action = isset($_POST['action']) ? $_POST['action'] : '';
     $mysql_server = 'X';
     $mysql_username = 'X';
     $mysql_password = 'X';
     $mysql_database = 'X';
     $mysql_table = 'LOL';
  
     $success_page = 'X';
     if ($action == 'signup')
     {
        $newusername = $_POST['username'];
        $newemail = $_POST['email'];
        $newpassword = $_POST['password'];
        $confirmpassword = $_POST['confirmpassword'];
        $newfullname = $_POST['fullname'];
        if ($newpassword != $confirmpassword)
        {
           $error_message = 'Password and Confirm Password are not the same!';
        }
        else
        if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newusername))
        {
           $error_message = 'Team name is not valid, please check and try again!';
        }
        else
        if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newpassword))
        {
           $error_message = 'Password is not valid, please check and try again!';
        }
        else
        if (!ereg("^.+@.+\..+$", $newemail))
        {
           $error_message = 'Email is not a valid email address. Please check and try again.';
        }
           $db = mysql_connect($mysql_server, $mysql_username, $mysql_password);
           mysql_select_db($mysql_database, $db);
           $sql = "SELECT username FROM ".$mysql_table." WHERE username = '".$newusername."'";
           $result = mysql_query($sql, $db);
           if ($data = mysql_fetch_array($result))
        {
           list($username, $password, $email, $fullname) = explode('|', trim($line));
           if ($newusername == $username)
           {
              $error_message = 'Team name already used. Please select another username.';
           }
        }
        if (empty($error_message))
        {
           $crypt_pass = md5($newpassword);
           $sql = "INSERT `".$mysql_table."` (`username`, `password`, `fullname`, `email`, `active`) VALUES ('$newusername', '$crypt_pass', '$newfullname', '$newemail', 1)";
           $result = mysql_query($sql, $db);
           mysql_close($db);
           $mailto = $newemail;
           $subject = 'X';
           $message = 'X';
           $message .= "\r\nX";
           $message .= "\r\n ";
           $message .= "\r\nTeam name for the upcoming tournament: ";
           $message .= $newusername;
           $message .= "\r\nYour password: ";
           $message .= $newpassword;
           $message .= "\r\n ";
           $message .= "\r\n ";
           $message .= "\r\nX";
           $message .= "\r\nX";
           $header  = "From: X"."\r\n";
           $header .= "Reply-To: X"."\r\n";
           $header .= "MIME-Version: 1.0"."\r\n";
           $header .= "Content-Type: text/plain; charset=utf-8"."\r\n";
           $header .= "Content-Transfer-Encoding: 8bit"."\r\n";
           $header .= "X-Mailer: PHP v".phpversion();
           mail($mailto, $subject, $message, $header);
           header('Location: '.$success_page);
           exit;
        }
     }
  }
  ?&gt;
  </code></pre>