Advertisement
Guest User

Untitled

a guest
Oct 10th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. <h4>Seus dados:</h4>
  2.  
  3. <input type="text" name="nome" placeholder="Nome..." class="quote-form-element" />
  4. <input type="text" name="cidade" placeholder="Cidade/UF..." class="quote-form-element quote-form-client-email last" />
  5. <input type="text" name="telefone" placeholder="Telefone..." class="quote-form-element telefone" />
  6. <input type="text" name="email" placeholder="E-mail..." class="quote-form-element quote-form-client-email last contact_email"
  7. />
  8.  
  9. <h4>Política de Privacidade</h4>
  10. <div class="checkbox quote-form-element" data-checked="yes" data-name="Política de Privacidade">
  11.  
  12. <span class="checkbox-status"><i class="fa fa-check"></i></span>
  13. <span class="checkbox-values">
  14.  
  15. <span class="checkbox-value-checked" style="font-size: 12px">Li e aceito a politica de privacidade</span></a>
  16. <span class="checkbox-value-unchecked" id="no">Não aceito</span>
  17. </span>
  18. </div>
  19.  
  20. <button class="button button-navy-blue send-quote" type="button">Simular meu consórcio <i class="fa fa-paper-plane-o"></i></button>
  21.  
  22. function Connect()
  23. {
  24. $dbhost = "localhost";
  25. $dbuser = "xxxxx";
  26. $dbpass = "xxxxx";
  27. $dbname = "xxxxx";
  28.  
  29.  
  30. $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname) or die($conn->connect_error);
  31.  
  32. return $conn;
  33. }
  34.  
  35. ?>
  36.  
  37. <?php
  38.  
  39.  
  40. $conn = Connect();
  41. $nome = $conn->real_escape_string($_POST['Nome']);
  42. $cidade = $conn->real_escape_string($_POST['cidade']);
  43. $telefone = $conn->real_escape_string($_POST['telefone']);
  44. $email = $conn->real_escape_string($_POST['email']);
  45. $query = "INSERT into leads_cform (nome,cidade,telefone,email) VALUES('" . $nome . "','" . $cidade . "','" . $telefone . "','" . $email . "')";
  46. $success = $conn->query($query);
  47.  
  48.  
  49. $conn->close();
  50.  
  51.  
  52.  
  53. $title = 'Nova simulação via website';
  54.  
  55.  
  56. $headers = "MIME-Version: 1.1n".
  57. "Content-type: text/html; charset=utf-8n".
  58. "Content-Transfer-Encoding: 8bitn".
  59. "From: ". $_POST['clientName'] ." <". $_POST['clientEmail'] .">n".
  60. "Reply-to: ". $_POST['clientName'] ." <". $_POST['clientEmail'] .">n".
  61. "Date: ". date( "r" ). "n";
  62.  
  63.  
  64. $values = $_POST['values'];
  65.  
  66.  
  67. $rows = '';
  68. if (count($values) > 0) {
  69. for( $i = 0; $i < count( $values ); $i++ ) {
  70.  
  71. $rows .= '<tr>
  72.  
  73. <td style="width: 200px; font-weight: bold; border: 1px solid #eee; padding: 10px;">'. $values[$i]['name'] .'</td>
  74. <td style="border: 1px solid #eee; padding: 10px;">'. $values[$i]['value'] .'</td>
  75.  
  76. </tr>';
  77. }
  78.  
  79.  
  80. $content = '<table style="width: 600px; font-size: 11px; border-collapse: collapse;">'. $rows .'</table>';
  81.  
  82.  
  83. $result = mail(
  84. OWNER_EMAIL,
  85. "=?UTF-8?B?". base64_encode( $title ) ."?=",
  86. $content,
  87. $headers
  88. );}
  89.  
  90.  
  91. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement