Advertisement
Guest User

Untitled

a guest
Sep 9th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  4. </head>
  5. <style>
  6. *{
  7. margin: 0px;
  8. padding: 0px;
  9. font-family: 'Ruda', sans-serif;
  10. }
  11. .loader {
  12. margin-top: 20%;
  13. border: 16px solid #f3f3f3; /* Light grey */
  14. border-top: 16px solid #5cb85c; /* Blue */
  15. border-radius: 50%;
  16. width: 120px;
  17. height: 120px;
  18. animation: spin 2s linear infinite;
  19. }
  20.  
  21. @keyframes spin {
  22. 0% { transform: rotate(0deg); }
  23. 100% { transform: rotate(360deg); }
  24. }
  25. </style>
  26. <?php
  27.  
  28. include("../../configs/conexao.php");
  29. require '../../configs/PHPMailer/class.phpmailer.php';
  30.  
  31. $nick = $_POST['nick'];
  32.  
  33. $pass = md5($_POST['pass']);
  34.  
  35. $email = $_POST['email'];
  36.  
  37. $meses = array (1 => "Janeiro", 2 => "Fevereiro", 3 => "Março", 4 => "Abril", 5 => "Maio", 6 => "Junho", 7 => "Julho", 8 => "Agosto", 9 => "Setembro", 10 => "Outubro", 11 => "Novembro", 12 => "Dezembro");
  38. $diasdasemana = array (1 => "Segunda-Feira",2 => "Terça-Feira",3 => "Quarta-Feira",4 => "Quinta-Feira",5 => "Sexta-Feira",6 => "Sábado",0 => "Domingo");
  39.  
  40. $variavel = date("d/m/Y");
  41. $variavel = str_replace('/','-',$variavel);
  42.  
  43. $hoje = getdate(strtotime($variavel));
  44.  
  45. $day = $hoje["mday"];
  46. $mes = $hoje["mon"];
  47. $month = $meses[$mes];
  48. $year = $hoje["year"];
  49. $diadasemana = $hoje["wday"];
  50. $dayname = $diasdasemana[$diadasemana];
  51. date_default_timezone_set('Europe/Lisbon');
  52. $hour = date("H:i:s");
  53.  
  54. function getUserIP()
  55. {
  56. $client = @$_SERVER['HTTP_CLIENT_IP'];
  57. $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
  58. $remote = $_SERVER['REMOTE_ADDR'];
  59.  
  60. if(filter_var($client, FILTER_VALIDATE_IP))
  61. {
  62. $ip = $client;
  63. }
  64. elseif(filter_var($forward, FILTER_VALIDATE_IP))
  65. {
  66. $ip = $forward;
  67. }
  68. else
  69. {
  70. $ip = $remote;
  71. }
  72.  
  73. return $ip;
  74. }
  75.  
  76.  
  77. $ip = getUserIP();
  78.  
  79.  
  80. $sql = mysqli_query($conn, "SELECT * FROM td_users WHERE email = '$email'");
  81.  
  82. if(mysqli_num_rows($sql)>0){
  83. echo "<center><div class='loader'></div></center>";
  84. echo "<center>Efetuando cadastro...</center>";
  85. echo '<script type="text/javascript">';
  86. echo 'setTimeout(function () { swal("Opss!","Cadastro não efetuado. \\n O E-mail: '.$email.' ja existe.","error");';
  87. echo '}, 1000);</script>';
  88. echo "<script>setTimeout(function(){location.href='index.php'} , 5000); </script>";
  89. }else{
  90. mysqli_query($conn, "INSERT INTO td_users (username,email,pass,ip,day,dayname,month,year,hour) VALUES ('$nick','$email','$pass','$ip','$day','$dayname','$month','$year','$hour')");
  91. echo "<center><div class='loader'></div></center>";
  92. echo "<center><strong>Efetuando cadastro...</strong></center>";
  93. echo '<script type="text/javascript">';
  94. echo 'setTimeout(function () { swal("Pronto!","Cadastro efetuado com sucesso! Agora logue-se.","success");';
  95. echo '}, 1000);</script>';
  96. echo "<script>setTimeout(function(){location.href='../login/index.php'} , 5000); </script>";
  97.  
  98. mkdir("../../users_image/".$nick."", 0777, true);
  99. mkdir("../../users_image/".$nick."", 0777, true);
  100.  
  101. $titulo = "Confirmacao de Cadastro";
  102.  
  103. $body = "
  104.  
  105.  
  106.  
  107. <center>
  108.  
  109. <b><h1>Obrigado Por se Registrar!</h1></b>
  110. <br>
  111. <h2><p>Confirme seu Cadastro</p></h2>
  112. <br><br>
  113. <div style='width: 160px; height: 45px; background-color: #007bff; cursor: pointer; border-radius: 10px;'>
  114. <a href='http://localhost:4000/mc/minhaconta/registrar/confirmacao.php?cod=".md5('123')."&email=".$email."' style='
  115. margin-top: 10px;
  116. font: 19px/20px sans-serif;
  117. color: #fff;
  118. background-color: #007bff;
  119. border: 1px solid #007bff;
  120. border-radius: 5px;
  121. cursor: pointer;
  122.  
  123. '>Clicando Aqui</a>
  124. </div>
  125. <br><br><br>
  126. <p>Ou Clicando no Link <a href='http://localhost:4000/mc/minhaconta/registrar/confirmacao.php?cod=".md5('123')."&email=".$email."'>http://localhost:4000/mc/minhaconta/registrar/confirmacao.php?cod=".md5('123')."&email=".$email."</a>
  127. <br><br>
  128. <p>Não efetuou este cadastro ?
  129. Entre em contato com o suporte <a href='suporte@dominio.com'>Clicando Aqui</a>
  130. </p>
  131. <p style='color: #818181;'>Não responda este e-mail.</p>
  132. <p style='display: inline;'><h4style='display: inline;'>Copyright</h4> <h3style='display: inline;'>©</h3> <a href='http://squalenetwork.tk/sy' style='display: inline;'> SqualeNetwork</a> <h4 style='display: inline;'>2018-2018</h4><p>
  133. </center>
  134.  
  135. ";
  136.  
  137. $Mailer = new PHPMailer();
  138.  
  139.  
  140. $Mailer->IsSMTP();
  141.  
  142.  
  143. $Mailer->isHTML(true);
  144.  
  145.  
  146. $Mailer->Charset = 'UTF-8';
  147.  
  148. $Mailer->SMTPAuth = true;
  149. $Mailer->SMTPSecure = 'ssl';
  150. $Mailer->SMTPDebug = 0;
  151.  
  152. $Mailer->Host = 'smtp.gmail.com';
  153.  
  154. $Mailer->Port = 465;
  155.  
  156.  
  157. $Mailer->Username = '';
  158. $Mailer->Password = '';
  159.  
  160.  
  161. $Mailer->From = '';
  162.  
  163.  
  164. $Mailer->FromName = '';
  165.  
  166.  
  167. $Mailer->Subject = $titulo;
  168.  
  169.  
  170. $Mailer->Body = $body;
  171.  
  172.  
  173. $Mailer->AltBody = '';
  174.  
  175.  
  176. $Mailer->AddAddress($email);
  177.  
  178. if($Mailer->Send()){
  179. //echo "E-mail enviado com sucesso";
  180. }else{
  181. //echo "Erro no envio do e-mail: " . $Mailer->ErrorInfo;
  182. }
  183.  
  184. }
  185.  
  186.  
  187. ?>
  188. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement