Advertisement
Guest User

Untitled

a guest
Jul 11th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.41 KB | None | 0 0
  1. <title>Signing up... | Project Club</title>
  2. <?php
  3. session_start();
  4. $servername = "oi censor matey";
  5. $serverusername = "le censor";
  6. $serverpassword = "censoraed";
  7. $serverdbname = "censored";
  8. $conn = new mysqli($servername, $serverusername, $serverpassword, $serverdbname);
  9. $uid = $_POST['uname'];
  10. $psw = $_POST['psw'];
  11. $email = $_POST['email'];
  12. $phone = $_POST['phone'];
  13. $phonecarrier = $_POST['phonecarrier'];
  14. $web = $_POST['web'];
  15. $fname = $_POST['fname'];
  16. $lname = $_POST['lname'];
  17. $accdeletecode = rand(1111111111, 2147483647);
  18. $chatverif = rand(1111111111, 2147483647);
  19. $phoneverif = rand(111111, 999999);
  20. $date = date('F jS Y h:i:s A');
  21. $ip = $_SERVER['REMOTE_ADDR'];
  22. $bday = $_POST['bday'];
  23. $bmonth = $_POST['bmonth'];
  24. $byear = $_POST['byear'];
  25. $plan = $_POST['plan'];
  26. if($plan == "0.00"){$paid = "YES";}else{$paid = "NO";}
  27. $emailverifsign1 = rand(1111111111, 2147483647);$emailverifsign2 = rand(1111111111, 2147483647);$emailverifsign3 = rand(1111111111, 2147483647);$emailverifsign4 = rand(1111111111, 2147483647);$emailverifsign5 = rand(1111111111, 2147483647);$emailverifsign6 = rand(1111111111, 2147483647);$emailverifsign7 = rand(1111111111, 2147483647);$emailverifsign8 = rand(1111111111, 2147483647);$emailverifsign9 = rand(1111111111, 2147483647);$emailverifsign10 = rand(1111111111, 2147483647);
  28. $emailverif = $emailverifsign1 . $emailverifsign2 . $emailverifsign3 . $emailverifsign4 . $emailverifsign5 . $emailverifsign6 . $emailverifsign7 . $emailverifsign8 . $emailverifsign9 . $emailverifsign10;
  29. $hashedpwd = password_hash($psw, PASSWORD_DEFAULT);
  30. $hashedphoneverif = password_hash($phoneverif, PASSWORD_DEFAULT);
  31. $hashedaccdelete = password_hash($accdeletecode, PASSWORD_DEFAULT);
  32. $hashedemailverif = password_hash($emailverif, PASSWORD_DEFAULT);
  33. $sql = "SELECT * FROM login WHERE username = '$uid' OR email = '$uid' ";
  34. if(empty($_POST['email'])){header("Location: /en/signup?emptyEMAIL");}
  35. if(empty($_POST['rep-email'])){header("Location: /en/signup?emptyREPEMAIL");}
  36. if($_POST['email'] !== $_POST['rep-email']){header("Location: /en/signup?emailNOMATCH");}
  37. if($_POST['psw'] !== $_POST['rep-psw']){header("Location: /en/signup?pswNOMATCH");}
  38. if(empty($_POST['uname'])){header("Location: /en/signup?emptyUNAME");}
  39. if(empty($_POST['phone'])){header("Location: /en/signup?emptyPHONE");}
  40. if($_POST['phonecarrier'] == "none"){header("Location: /en/signup?emptyPHONECARR");}
  41. if($_POST['plan'] == "none"){header("Location: /en/signup?emptyPLAN");}
  42. if(empty($_POST['fname'])){header("Location: /en/signup?emptyFNAME");}
  43. if(empty($_POST['lname'])){header("Location: /en/signup?emptyLNAME");}
  44. if(empty($_POST['web'])){header("Location: /en/signup?emptyWEB");}
  45. if(empty($_POST['psw'])){header("Location: /en/signup?emptyPSW");}
  46. if(empty($_POST['rep-psw'])){header("Location: /en/signup?emptyREPSW");}
  47. if(empty($_POST['bday'])){header("Location: /en/signup?emptyBDAY");}
  48. if(empty($_POST['bmonth'])){header("Location: /en/signup?emptyBMONTH");}
  49. if(empty($_POST['byear'])){header("Location: /en/signup?emptyBYEAR");}
  50. if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {header("Location: /en/signup?invalidEMAIL");}
  51. if (strlen($_POST['uid']) < 6){header("Location: /en/signup?usernameLESS6");}
  52. if (strlen($_POST['bday']) !== 2){header("Location: /en/signup?bdayNOT2");}
  53. if (strlen($_POST['bmonth']) !== 2){header("Location: /en/signup?bmonthNOT2");}
  54. if (strlen($_POST['byear']) !== 4){header("Location: /en/signup?byearNOT4");}
  55. if (strlen($_POST['uid']) > 16){header("Location: /en/signup?usernameMORE16");}
  56. if (strlen($_POST['psw']) < 5){header("Location: /en/signup?passwordLESS6");}
  57. if (strlen($_POST['psw']) > 16){header("Location: /en/signup?passwordMORE16");}
  58. if (!preg_match("/^[a-zA-Z ]*$/",$_POST['fname'])) {header("Location: /en/signup?fnameWHITESPACE");}
  59. if (!preg_match("/^[a-zA-Z ]*$/",$_POST['lname'])) {header("Location: /en/signup?lnameWHITESPACE");}
  60. $resultusernamecheck = $conn->query("SELECT id FROM login WHERE username = '$uid'");if($resultusernamecheck->num_rows == 0) {header("Location: /en/signup?usernameTAKEN");}
  61. $resultemailcheck = $conn->query("SELECT id FROM login WHERE email = '$email'");if($resultemailcheck->num_rows == 0) {header("Location: /en/signup?emailTAKEN");}
  62. $resultphonecheck = $conn->query("SELECT id FROM login WHERE phone = '$phone'");if($resultemailcheck->num_rows == 0) {header("Location: /en/signup?phoneTAKEN");}
  63. $resultwebcheck = $conn->query("SELECT id FROM login WHERE website = '$web'");if($resultwebcheck->num_rows == 0) {header("Location: /en/signup?webTAKEN");}
  64. if (strlen($_POST['phone']) !== 10){header("Location: /en/signup?phoneNOT10");}
  65. $phoneto = "$phone@$phonecarrier";
  66. $phonefrom = "support@4424cub.xyz";
  67. $phonemessage = "Congradulations! You successfully created an account on Project Club.nYour phone verification code is $phoneverif. Have fun!";
  68. $phoneheaders = "From: Project Club Phone Verification";
  69. mail($phoneto, '', $phonemessage, $phoneheaders);
  70.  
  71. $subject = $uid . ", Confirm your Email | Project Club";
  72. $from = 'noreply@4424club.xyz';
  73. $headers = 'MIME-Version: 1.0' . "rn";
  74. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
  75. $headers .= 'From: '.$from."rn";
  76. $emailmessage = '
  77. <h1 style="color:red;text-align:center;">Hi, $uid</h1>
  78. <p style="color:blue;text-align:center;">You used this email to create an account at Project Club.</p>
  79. <p style="color:blue;text-align:center;">If this was not you, please contact us at support@4424club.xyz.</p>
  80. <p style="color:blue;text-align:center;">If this was you, click the button below to verify your account.</p>
  81. <form action="https://4424club.xyz.412quack.com/en/confirm-email" method="post">
  82. <input type="text" name="username" value="$uid" type="hidden" style="display:none;">
  83. <input type="text" name="code" value="$emailverif" type="hidden" style="display:none;">
  84. <input style="text-align:center;text-decoration:none;display:block;font-size:16px;background-color:red;color:white;border:2px solid #f44336;margin-left:auto;margin-right:auto;" type="submit" value="Verify My Email">
  85. </form>
  86. <p style="color:blue;text-align:center;">Enjoy your stay at Project Club!</p>';
  87. mail($email,$subject,$emailmessage,$headers);
  88.  
  89. /*
  90. $userfile = fopen("users/" . $uid . ".php", "w") or die("Error writing user file.");
  91. fwrite($userfile, $write);
  92. fclose($userfile);
  93. */
  94. $sql = "INSERT INTO login (id, username, email, phone, password, ip, date, status, profilepicturelink, phoneverifcode, phoneverified, emailverifcode, emailverified, userlevel, accdeletecode, banned, bandate, bantil, banreason, friends, friendcount, level, exp, reputation, blocks, blockcount, tokens, phonecarrier, sex, website, plan, paid, birthday, birthmonth, birthyear, chatverifcode) VALUES ('', '$uid', '$email', '$phone', '$hashedpwd', '$ip', '$date', 'NO', 'https://4424club.xyz/files/images/user.png', '$hashedphoneverif', 'NO', '$hashedemailverif', 'NO', 'Member', '$hashedaccdelete', 'NO', 'NONE', 'NONE', 'NONE', 'NONE', '0', '0', '0', '0', 'NONE', '0', '0', '$phonecarrier', 'TBA', '$web', '$plan', '$paid', '$bday', '$bmonth', '$byear', '$chatverif')";
  95. if (mysqli_query($conn, $sql)){header("Location: /en/signup?success");}else{header("Location: /en/signup?unknownERR");}
  96.  
  97. mysqli_close($conn);
  98. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement