Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. <?php
  2. if($register) {
  3. if (isset($_POST['username'])) {
  4. $check_login = $account->prepare("SELECT count(*) FROM account WHERE login = '".$_POST['username']."'");
  5. $check_login->execute();
  6. $check_login = $check_login->fetchColumn();
  7.  
  8. $check_email = $account->prepare("SELECT count(*) FROM account WHERE email = '".$_POST['email']."'");
  9. $check_email->execute();
  10. $check_email = $check_email->fetchColumn();
  11.  
  12. if($check_login>0)
  13. print '<div class="headline">
  14. <center><font color="red">Nume de utilizator indisponibil.</font></center>
  15. </div>';
  16. else if($check_email>0)
  17. print '<div class="headline">
  18. <center><font color="red">Acest e-mail este folosit deja de un</br></br> alt cont.</font></center>
  19. </div>';
  20. else {
  21. if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
  22. if($_POST['pw'] == $_POST['repeat_pw']) {
  23.  
  24. $hash = "*" . sha1(sha1($_POST['pw'], true));
  25. $password = strtoupper($hash);
  26.  
  27. if($bonus)
  28. $expire = "20221218131717"; //Data expirarii sanselor (2022-12-18 13:17:17)
  29. else
  30. $expire = "0";
  31. $sql = "INSERT INTO account(login,
  32. password,
  33. social_id,
  34. email,
  35. create_time,
  36. status,
  37. gold_expire,
  38. silver_expire,
  39. safebox_expire,
  40. autoloot_expire,
  41. fish_mind_expire,
  42. marriage_fast_expire,
  43. money_drop_rate_expire) VALUES (
  44. :login,
  45. :password,
  46. :social_id,
  47. :email,
  48. NOW(),
  49. :status,
  50. :gold_expire,
  51. :silver_expire,
  52. :safebox_expire,
  53. :autoloot_expire,
  54. :fish_mind_expire,
  55. :marriage_fast_expire,
  56. :money_drop_rate_expire)";
  57.  
  58. $stmt = $account->prepare($sql);
  59.  
  60. $stmt->bindParam(':login', $_POST['username'], PDO::PARAM_STR);
  61. $stmt->bindParam(':password', $password, PDO::PARAM_STR);
  62. $stmt->bindParam(':social_id', $_POST['delcode'], PDO::PARAM_STR);
  63. $stmt->bindParam(':email', $_POST['email'], PDO::PARAM_STR);
  64. $stmt->bindParam(':status', $status_register, PDO::PARAM_STR);
  65.  
  66. $stmt->bindParam(':gold_expire', $expire, PDO::PARAM_STR);
  67. $stmt->bindParam(':silver_expire', $expire, PDO::PARAM_STR);
  68. $stmt->bindParam(':safebox_expire', $expire, PDO::PARAM_STR);
  69. $stmt->bindParam(':autoloot_expire', $expire, PDO::PARAM_STR);
  70. $stmt->bindParam(':fish_mind_expire', $expire, PDO::PARAM_STR);
  71. $stmt->bindParam(':marriage_fast_expire', $expire, PDO::PARAM_STR);
  72. $stmt->bindParam(':money_drop_rate_expire', $expire, PDO::PARAM_STR);
  73.  
  74. $stmt->execute();
  75. print '<div class="headline">
  76. <center><font color="green">Contul tău a fost creat cu succes! </br></br>Te poți loga în joc.</font></center>
  77. </div>';
  78. }
  79. else
  80. print '<div class="headline">
  81. <center><font color="red">Parolele nu se potrivesc.</font></center>
  82. </div>';
  83. }
  84. else
  85. print '<div class="headline">
  86. <center><font color="red">Adresa de e-mail este invalidă.</font></center>
  87. </div>';
  88. }
  89. }
  90. ?>
  91. <form action="#registration" method="post">
  92. <input type="text" pattern=".{5,16}" maxlength="16" required="required" name="username" placeholder="Nume utilizator" />
  93. <div class="reg_info">
  94. Între 5 și 16 caractere. Trebuie să conțină litere și numere.
  95. </div>
  96. <input type="email" required="required" name="email" placeholder="E-mail" />
  97. <div class="reg_info">
  98. Trebuie să fie o adresă de e-mail validă.
  99. </div>
  100. <input id="reg_pw" pattern=".{5,}" type="password" required="required" name="pw" placeholder="Parolă" />
  101. <div class="reg_info">
  102. Cel puțin 5 caractere. Cel mai bun caz, cu litere mari și mici, numere și caractere speciale.
  103. </div>
  104. <input id="reg_pw2" pattern=".{5,}" type="password" required="required" name="repeat_pw" placeholder="Repetă parola" />
  105. <div class="reg_info">
  106. Scrie din nou parola de mai sus.
  107. </div>
  108. <input type="number" min="1000000" max="9999999" required="required" name="delcode" placeholder="Cod ștergere" id="delcodeInput"/>
  109. <div class="reg_info">
  110. Trebuie de 7 cifre. Litere și caractere speciale nu sunt permise.
  111. </div>
  112. <button class="btn" type="submit" name="submit">Înregistrare!</button>
  113. </form>
  114. <?php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement