Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <form class="contact-form pull-left" action="contactform.php" style="width: 100%;" method="post">
  2. <input type="text" name="nome" placeholder="Nome" class="col-xs-12" required><br>
  3. <input type="text" name="assunto" placeholder="Assunto" class="col-xs-12" required><br>
  4. <input type="email" name="email" placeholder="E-mail" class="col-xs-12"><br>
  5. <input type="text" name="telefone" data-mask="(00) 0000-0000" placeholder="Telefone" required class="col-xs-12"><br>
  6. <select class="form-control" id="estados" name="estados">
  7. <option>Escolha seu Estado</option>
  8. <?php
  9. $query = "select * from estados;";
  10. $dt = mysqli_query($conn, $query);
  11. while ($row = mysqli_fetch_array($dt)){
  12. ?>
  13. <option value="<?php echo $row['estado_id'];?>"><?php echo $row['nome'];?></option>
  14. <?php }; ?>
  15.  
  16. </select>
  17. <select class="form-control" id="cidades" name="cidades">
  18. <option value="">Escolha sua Cidade</option>
  19. </select>
  20.  
  21.  
  22. <textarea name="message" class="pull-left col-xs-12"></textarea><br>
  23. <button type="submit" name="submit" class="pull-left btn btn-dark">Enviar</button>
  24. </form>
  25.  
  26. <?php
  27. include 'conection.php';
  28.  
  29. if(isset ($_POST['submit'])){
  30.  
  31.  
  32.  
  33.  
  34. $to_add = "gassembweb@gmail.com";
  35. $subject = $_POST['assunto'];
  36. $writ = $_POST['nome'];
  37.  
  38.  
  39.  
  40.  
  41. $tel = $_POST['telefone'];
  42. $mail = $_POST['email'];
  43.  
  44. if (!empty($_POST['estado_id']) && ($_POST['cidade_id'])){
  45. $st = $_POST['estado_id'];
  46. $st2 = $_POST['cidade_id'];
  47. }
  48.  
  49. $message = (
  50. "Essa mensagem foi esrita por: ".$writ. "n". "email e (ou) telefone: ".$mail." / ".$tel. "n"."n"."mora em: ".$st." - ".$st2."n".$_POST['message']);
  51.  
  52.  
  53. $headers .= "X-Mailer: PHP rn";
  54.  
  55.  
  56.  
  57. mail($to_add,$subject,$message,$headers);
  58.  
  59.  
  60.  
  61. }
  62. header ("Location: mailsucess.php");
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement