Guest User

Untitled

a guest
Jul 2nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <?php
  2. /*
  3. THIS WHOLE SYSTEM WAS CREATED BY Haze aka Blubb1337.
  4.  
  5. ALL RIGHTS RESERVED (C) 2011
  6.  
  7. SHARING THIS ON OTHER SITES IS FORBIDDEN UNLESS I GIVE YOU THE PERMISSION TO DO IT.
  8.  
  9. PLEASE ENJOY AND IF YOU FIND ANY BUGS OR YOU HAVE IDEAS THAT CAN BE ADDED INTO THIS SYSTEM, please tell me.
  10. */
  11. ?>
  12.  
  13. <?php
  14.  
  15. include("conn.php");
  16.  
  17. /* Table structure
  18. id
  19. username
  20. password
  21. email
  22. ip
  23. hwid
  24. activationlink
  25. activated
  26. banned
  27. */
  28.  
  29. /*page should look like this
  30. register.php?username=&password=&email=&hwid=*/
  31.  
  32. function genRandomString() {
  33.     $length = 20;
  34.     $characters = "0123456789abcdefghijklmnopqrstuvwxyz";  
  35.     for ($p = 0; $p < $length; $p++) {
  36.         $string .= $characters[mt_rand(0, strlen($characters))];
  37.     }
  38.     return $string;
  39. }
  40.  
  41. $username = $_GET['username'];
  42. $password = $_GET['password'];
  43. $pw = md5($password);
  44. $email = $_GET['email'];
  45. $ip = $_SERVER['REMOTE_ADDR'];
  46. $hwid = $_GET['hwid'];
  47. $alink = genRandomString();
  48.  
  49. //account limit per PC
  50. $acclimit = 5;
  51.  
  52. //see if all variables are filled
  53. if(isset($username)) {
  54. if(isset($pw)) {
  55. if(isset($email)) {
  56. if(isset($hwid)) {
  57. if(isset($alink)) {
  58. //see if the user already exists
  59. $querySearch = "SELECT * FROM users WHERE Username='".$username."' OR Email='".$email."'";
  60.  
  61. $result = mysql_query($querySearch);
  62. $count = mysql_num_rows($result);
  63.  
  64. if($count == 0) {
  65. $queryLimit = "SELECT * FROM users WHERE HWID='".$hwid."'";
  66. $result = mysql_query($queryLimit);
  67. $count = mysql_num_rows($result);
  68.  
  69. if($count < $acclimit or $count == $acclimit) {
  70.  
  71. $query = "INSERT INTO users(Username,Password,Email,IP,HWID,ActivationLink,Activated,Banned)
  72. VALUES
  73. ('".$username."','".$pw."','".$email."','".$ip."','".$hwid."','".$alink."','0','0')";
  74.  
  75. echo $query."<br />";
  76.  
  77. mysql_query($query) or die(mysql_error());
  78.  
  79. } else {
  80. echo "You have reached the limit of maximum accounts per PC."; }
  81. } else {
  82. echo "There is already an account with the same username or email"; }
  83. }}}}}
  84. ?>
Add Comment
Please, Sign In to add comment