Guest User

Untitled

a guest
Nov 26th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. <div class="contact">
  2.  
  3. <div class="container">
  4. <h1>Finalizar Compra</h1>
  5. <div class="contact-form">
  6.  
  7. <div class="col-md-8 contact-grid">
  8.  
  9.  
  10. <form action="mailcl.php" method="post">
  11.  
  12.  
  13.  
  14.  
  15. <div class="container">
  16. <div class="check">
  17. <h1>Revisão</h1>
  18. <br>
  19. <br>
  20. <br>
  21.  
  22. <?php
  23.  
  24. echo 'Nome';
  25. echo '<input type="text" name="nome">';
  26. echo'Email';
  27. echo '<input type="text" name="email" >';
  28. echo'Senha';
  29. echo '<input type="password" name="senha" >';
  30.  
  31. <div class="send">
  32.  
  33.  
  34. <input type="submit" value="Comprar">
  35. </div>
  36. </form>
  37. </div>';
  38.  
  39. ?>
  40.  
  41. //Codigo onde a compra é enviada no email
  42.  
  43. <html>
  44. <title>Autenticando usuario</title>
  45. <head>
  46. <style type="text/css">
  47.  
  48.  
  49.  
  50. </style>
  51. <script type="text/javascript">
  52. function LoginSucessfully(){
  53. setTimeout("window.location='index.php'",5000);
  54. }
  55.  
  56.  
  57. </script>
  58. </head>
  59. <body>
  60. </body>
  61.  
  62. </html>
  63. <html>
  64. <title>Autenticando usuario</title>
  65. <head>
  66. <style type="text/css">
  67.  
  68.  
  69.  
  70. </style>
  71. <script type="text/javascript">
  72. function LoginFailed(){
  73. setTimeout("window.location='finalizacompra.php'",5000);
  74. }
  75. </script>
  76.  
  77.  
  78. </head>
  79. <body>
  80. </body>
  81.  
  82. </html>
  83.  
  84.  
  85.  
  86. <?php
  87.  
  88.  
  89. require "PHPMailer-master/PHPMailerAutoload.php";
  90.  
  91.  
  92. $nome = $_POST['nome'];
  93. $email = $_POST['email'];
  94. $tabela = $_POST['tabela'];
  95.  
  96.  
  97. $mail = new PHPMailer;
  98.  
  99. //$mail->SMTPDebug = 3; // Enable verbose debug output
  100.  
  101. $mail->isSMTP(); // Set mailer to use SMTP
  102. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  103. $mail->SMTPAuth = true; // Enable SMTP authentication
  104. $mail->Username = 'marveldc999loja@gmail.com'; // SMTP username
  105. $mail->Password = '**********'; // SMTP password
  106. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  107. $mail->Port = 587; // TCP port to connect to
  108.  
  109. $mail->setFrom('from@example.com', 'MarvelDC');
  110. $mail->addAddress('marveldc999loja@gmail.com');
  111. $mail->addAddress($email); // Add a recipient
  112. //$mail->addAddress('ellen@example.com'); // Name is optional
  113. //$mail->addReplyTo('info@example.com', 'Information');
  114. //$mail->addCC('cc@example.com');
  115. //$mail->addBCC('bcc@example.com');
  116.  
  117. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  118. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  119. $mail->isHTML(true); // Set email format to HTML
  120.  
  121. $mail->Subject = $email;
  122. $mail->Body = $nome;
  123. $mail->Body = $tabela;
  124.  
  125. $mail->Subject = "Compra efeituada com sucesso!!!";
  126. $mail->Body = "<!DOCTYPE html>
  127. <html lang='pt-br'>
  128. <head>
  129. <meta charset='utf-8'/>
  130. <meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'>
  131. <title>Título da Página (Estrutura básica de uma página com HTML 5)</title>
  132. <link href='css/seu-stylesheet.css' rel='stylesheet'/>
  133. <script src='scripts/seu-script.js'></script>
  134. </head>
  135. <body>
  136.  
  137. <font color='black' face='arial' size='4px'>Olá, $nome<p>
  138. <h3>Recebemos o seu pedido!</h3><p> Deposite Nessa Conta o Valor da compra: 4752564814 01 Apos o deposito entraremos em contato para o envio!
  139.  
  140.  
  141. </font>
  142.  
  143. $tabela
  144.  
  145. </html>
  146. ";
  147.  
  148.  
  149.  
  150. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  151.  
  152. if(!$mail->send()) {
  153. echo"<center><font color = black>Email ou senha invalidos!!Aguarde um instante para tentar novamente.</font></center>";
  154. echo "<script>LoginFailed()</script>";
  155. }else{
  156. echo"
  157. <br>
  158. <br>
  159. ";
  160. echo"<center><h1><font color='black' face='arial' >O email foi enviado com sucesso!Aguarde um instante que voce sera redirecionado a pagina Home.</font></h1></center>";
  161.  
  162. echo"<br> <br>";
  163.  
  164. echo"<center><img src='images/carregamento.gif'></center>";
  165.  
  166. echo"<script>LoginSucessfully()</script>";
  167. }
  168.  
  169. ?>
Add Comment
Please, Sign In to add comment