Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
- </head>
- <style>
- *{
- margin: 0px;
- padding: 0px;
- font-family: 'Ruda', sans-serif;
- }
- .loader {
- margin-top: 20%;
- border: 16px solid #f3f3f3; /* Light grey */
- border-top: 16px solid #5cb85c; /* Blue */
- border-radius: 50%;
- width: 120px;
- height: 120px;
- animation: spin 2s linear infinite;
- }
- @keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
- }
- </style>
- <?php
- include("../../configs/conexao.php");
- require '../../configs/PHPMailer/class.phpmailer.php';
- $nick = $_POST['nick'];
- $pass = md5($_POST['pass']);
- $email = $_POST['email'];
- $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");
- $diasdasemana = array (1 => "Segunda-Feira",2 => "Terça-Feira",3 => "Quarta-Feira",4 => "Quinta-Feira",5 => "Sexta-Feira",6 => "Sábado",0 => "Domingo");
- $variavel = date("d/m/Y");
- $variavel = str_replace('/','-',$variavel);
- $hoje = getdate(strtotime($variavel));
- $day = $hoje["mday"];
- $mes = $hoje["mon"];
- $month = $meses[$mes];
- $year = $hoje["year"];
- $diadasemana = $hoje["wday"];
- $dayname = $diasdasemana[$diadasemana];
- date_default_timezone_set('Europe/Lisbon');
- $hour = date("H:i:s");
- function getUserIP()
- {
- $client = @$_SERVER['HTTP_CLIENT_IP'];
- $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
- $remote = $_SERVER['REMOTE_ADDR'];
- if(filter_var($client, FILTER_VALIDATE_IP))
- {
- $ip = $client;
- }
- elseif(filter_var($forward, FILTER_VALIDATE_IP))
- {
- $ip = $forward;
- }
- else
- {
- $ip = $remote;
- }
- return $ip;
- }
- $ip = getUserIP();
- $sql = mysqli_query($conn, "SELECT * FROM td_users WHERE email = '$email'");
- if(mysqli_num_rows($sql)>0){
- echo "<center><div class='loader'></div></center>";
- echo "<center>Efetuando cadastro...</center>";
- echo '<script type="text/javascript">';
- echo 'setTimeout(function () { swal("Opss!","Cadastro não efetuado. \\n O E-mail: '.$email.' ja existe.","error");';
- echo '}, 1000);</script>';
- echo "<script>setTimeout(function(){location.href='index.php'} , 5000); </script>";
- }else{
- 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')");
- echo "<center><div class='loader'></div></center>";
- echo "<center><strong>Efetuando cadastro...</strong></center>";
- echo '<script type="text/javascript">';
- echo 'setTimeout(function () { swal("Pronto!","Cadastro efetuado com sucesso! Agora logue-se.","success");';
- echo '}, 1000);</script>';
- echo "<script>setTimeout(function(){location.href='../login/index.php'} , 5000); </script>";
- mkdir("../../users_image/".$nick."", 0777, true);
- mkdir("../../users_image/".$nick."", 0777, true);
- $titulo = "Confirmacao de Cadastro";
- $body = "
- <center>
- <b><h1>Obrigado Por se Registrar!</h1></b>
- <br>
- <h2><p>Confirme seu Cadastro</p></h2>
- <br><br>
- <div style='width: 160px; height: 45px; background-color: #007bff; cursor: pointer; border-radius: 10px;'>
- <a href='http://localhost:4000/mc/minhaconta/registrar/confirmacao.php?cod=".md5('123')."&email=".$email."' style='
- margin-top: 10px;
- font: 19px/20px sans-serif;
- color: #fff;
- background-color: #007bff;
- border: 1px solid #007bff;
- border-radius: 5px;
- cursor: pointer;
- '>Clicando Aqui</a>
- </div>
- <br><br><br>
- <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>
- <br><br>
- <p>Não efetuou este cadastro ?
- Entre em contato com o suporte <a href='suporte@dominio.com'>Clicando Aqui</a>
- </p>
- <p style='color: #818181;'>Não responda este e-mail.</p>
- <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>
- </center>
- ";
- $Mailer = new PHPMailer();
- $Mailer->IsSMTP();
- $Mailer->isHTML(true);
- $Mailer->Charset = 'UTF-8';
- $Mailer->SMTPAuth = true;
- $Mailer->SMTPSecure = 'ssl';
- $Mailer->SMTPDebug = 0;
- $Mailer->Host = 'smtp.gmail.com';
- $Mailer->Port = 465;
- $Mailer->Username = '';
- $Mailer->Password = '';
- $Mailer->From = '';
- $Mailer->FromName = '';
- $Mailer->Subject = $titulo;
- $Mailer->Body = $body;
- $Mailer->AltBody = '';
- $Mailer->AddAddress($email);
- if($Mailer->Send()){
- //echo "E-mail enviado com sucesso";
- }else{
- //echo "Erro no envio do e-mail: " . $Mailer->ErrorInfo;
- }
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement