Guest User

Untitled

a guest
Oct 9th, 2017
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.29 KB | None | 0 0
  1. <div class="headerfix" id="orcamento">
  2.         <section>
  3.             <div class="wrapper text-center  padding-default-top padding-default-bottom">
  4.                 <h1 class="section-title wow fadeInDown">Orçamento</h1>
  5.                 <p class="section-subtitle wow fadeInUp" data-wow-delay="0.2s">
  6.                     Como podemos te ajudar?<br/>
  7.                     Solicite um orçamento e dê o primeiro passo na conquista da sua beleza.
  8.                 </p>
  9.  
  10.                 <form action="" role="form" method="post">
  11.                         <?php
  12.                             $prefixo_assunto = '[Solicitaçao de orçamento]'; 
  13.                             $email_admin = 'raphael_360@hotmail.com';
  14.  
  15.                             if($_SERVER['REQUEST_METHOD'] == 'POST') {
  16.                                 $nome    = stripslashes(trim($_POST['form-nome']));
  17.                                 $email   = stripslashes(trim($_POST['form-email']));
  18.                                 $observacao   = stripslashes(trim($_POST['form-observacao']));
  19.                                 $tipo   = stripslashes(trim($_POST['orcamento-tipo']));
  20.                                 $procedimentos   = stripslashes(trim($_POST['form-procedimentos']));
  21.                                 $telefone   = stripslashes(trim($_POST['form-tel']));
  22.                                 $pattern = '/[\r\n]|Content-Type:|Bcc:|Cc:/i';
  23.  
  24.                                 if (preg_match($pattern, $nome)) {
  25.                                     die("Header injection detected");
  26.                                 }
  27.  
  28.                                 if($nome && $email && $tipo && $telefone){
  29.                                     $subject = "$prefixo_assunto $tipo - $nome";
  30.                                     $body = "Nome: <b>$nome</b><br/>Telefone: <b>$telefone</b> <br /><br />Email: <b>$email</b> <br /> Tipo: <b>$tipo</b> <br /> Procedimentos: <b>$procedimentos</b> <br /> Observaçoes: <b>$observacao</b>";
  31.  
  32.                                     $headers  = "MIME-Version: 1.1" . PHP_EOL;
  33.                                     $headers .= "Content-type: text/html; charset=utf-8" . PHP_EOL;
  34.                                     $headers .= "Content-Transfer-Encoding: 8bit" . PHP_EOL;
  35.                                     $headers .= "Date: " . date('r', $_SERVER['REQUEST_TIME']) . PHP_EOL;
  36.                                     $headers .= "Message-ID: <" . $_SERVER['REQUEST_TIME'] . md5($_SERVER['REQUEST_TIME']) . '@' . $_SERVER['SERVER_NAME'] . '>' . PHP_EOL;
  37.                                     $headers .= "From: " . "=?UTF-8?B?".base64_encode($nome)."?=" . "<contato@raphaelbrandao.com>" . PHP_EOL;
  38.                                     $headers .= "Return-Path: $email_admin" . PHP_EOL;
  39.                                     $headers .= "Reply-To: contato@raphaelbrandao.com" . PHP_EOL;
  40.                                     $headers .= "X-Mailer: PHP/". phpversion() . PHP_EOL;
  41.                                     $headers .= "X-Originating-IP: " . $_SERVER['SERVER_ADDR'] . PHP_EOL;
  42.  
  43.                                     mail($email_admin, "=?utf-8?B?".base64_encode($subject)."?=", $body, $headers);
  44.                                     $email_enviado = true;
  45.                                 } else {
  46.                                     $erro_envio = true;
  47.                                 }
  48.                             }
  49.                         ?>
  50.                         <?php if(!empty($email_enviado)) {
  51.                                 echo "<script>alert('Solicitaçao enviada! Agradecemos e retornaremos em breve.');</script>";
  52.                                     echo "<script>location.href='<?php echo get_settings('home'); ?>';</script>";
  53.                             }
  54.                             else {
  55.                                 if (!empty($erro_envio)) {
  56.                                     echo "<script>alert('Ocorreu algum erro, tente novamente mais tarde.');</script>";
  57.                                     echo "<script>location.href='<?php echo get_settings('home'); ?>';</script>";
  58.                                 }
  59.                             }
  60.                         ?>
  61.                         <div class="form row padding-default-top">
  62.                             <div class="col-6 padding-supersmall-right padding-small-bottom padding-phablet-zero wow fadeInDown" data-wow-delay="0.3s">
  63.                                 <input name="form-nome" id="form-nome" type="text" placeholder="Seu nome" required>
  64.                             </div>
  65.                             <div class="col-6 padding-supersmall-left padding-small-bottom padding-phablet-zero wow fadeInDown" data-wow-delay="0.3s">
  66.                                 <strong class="section-paragraph text-left display-block padding-supersmall-bottom">Tipo</strong>
  67.                                 <div class="row">
  68.                                     <div class="radio col-4">
  69.                                         <input id="orcamento-tipo1" value="Corporal" name="orcamento-tipo" type="radio" checked>
  70.                                         <label for="orcamento-tipo1">Corporal</label>
  71.                                     </div>
  72.                                     <div class="radio col-4">
  73.                                         <input id="orcamento-tipo2" value="Facial" name="orcamento-tipo" type="radio">
  74.                                         <label for="orcamento-tipo2">Facial</label>
  75.                                     </div>
  76.                                     <div class="radio col-4">
  77.                                         <input id="orcamento-tipo3" value="Beleza" name="orcamento-tipo" type="radio">
  78.                                         <label for="orcamento-tipo3">Beleza</label>
  79.                                     </div>
  80.                                 </div>
  81.                             </div>
  82.                             <div class="col-6 padding-supersmall-right padding-small-bottom padding-phablet-zero wow fadeInDown" data-wow-delay="0.3s">
  83.                                 <input name="form-tel" id="form-tel" type="text" placeholder="Fone" required>
  84.                             </div>
  85.                             <div class="col-6 padding-supersmall-left padding-small-bottom padding-phablet-zero wow fadeInDown" data-wow-delay="0.3s">
  86.                                 <input id="form-procedimentos" name="form-procedimentos" type="text" placeholder="Quais procedimentos?">
  87.                             </div>
  88.                             <div class="col-6 padding-supersmall-right padding-small-bottom padding-phablet-zero wow fadeInDown" data-wow-delay="0.3s">
  89.                                 <input name="form-email" id="form-email" type="email" placeholder="Email" required>
  90.                             </div>
  91.                             <div class="col-6 padding-supersmall-left padding-small-bottom padding-phablet-zero wow fadeInDown" data-wow-delay="0.3s">
  92.                                 <input id="form-observacao" name="form-observacao" type="text" placeholder="Alguma observação?">
  93.                             </div>
  94.                             <div class="col-12 padding-medium-top wow fadeInDown" data-wow-delay="0.6s">
  95.                                 <button class="button" type="submit">Enviar</button>
  96.                             </div>
  97.                         </div>
  98.                     </form>
  99.             </div>
  100.         </section>
  101.     </div>
  102.  
  103.     <div class="headerfix" id="contato">
  104.         <form action="" role="form" method="post">
  105.         <?php
  106.             $prefixo_assunto = '[Contato através do site]';
  107.             $email_admin = 'raphael@growthinternet.com';
  108.  
  109.             if($_SERVER['REQUEST_METHOD'] == 'POST') {
  110.                 $nome    = stripslashes(trim($_POST['form-nome']));
  111.                 $assunto   = stripslashes(trim($_POST['form-assunto']));
  112.                 $mensagem   = stripslashes(trim($_POST['form-mensagem']));
  113.                 $telefone   = stripslashes(trim($_POST['form-tel']));
  114.                 $pattern = '/[\r\n]|Content-Type:|Bcc:|Cc:/i';
  115.  
  116.                 if (preg_match($pattern, $nome)) {
  117.                     die("Header injection detected");
  118.                 }
  119.  
  120.                 if($nome && $assunto && $mensagem && $telefone){
  121.                     $subject = "$prefixo_assunto $nome";
  122.                     $body = "Nome: <b>$nome</b><br/>Telefone: <b>$telefone</b> <br /><br />Assunto: <b>$assunto</b> <br /> Mensagem: <b>$mensagem</b>";
  123.  
  124.                     $headers  = "MIME-Version: 1.1" . PHP_EOL;
  125.                     $headers .= "Content-type: text/html; charset=utf-8" . PHP_EOL;
  126.                     $headers .= "Content-Transfer-Encoding: 8bit" . PHP_EOL;
  127.                     $headers .= "Date: " . date('r', $_SERVER['REQUEST_TIME']) . PHP_EOL;
  128.                     $headers .= "Message-ID: <" . $_SERVER['REQUEST_TIME'] . md5($_SERVER['REQUEST_TIME']) . '@' . $_SERVER['SERVER_NAME'] . '>' . PHP_EOL;
  129.                     $headers .= "From: " . "=?UTF-8?B?".base64_encode($nome)."?=" . "<raphael_360@hotmail.com>" . PHP_EOL;
  130.                     $headers .= "Return-Path: $email_admin" . PHP_EOL;
  131.                     $headers .= "Reply-To: raphael_360@hotmail.com" . PHP_EOL;
  132.                     $headers .= "X-Mailer: PHP/". phpversion() . PHP_EOL;
  133.                     $headers .= "X-Originating-IP: " . $_SERVER['SERVER_ADDR'] . PHP_EOL;
  134.  
  135.                     mail($email_admin, "=?utf-8?B?".base64_encode($subject)."?=", $body, $headers);
  136.                     $email_enviado = true;
  137.                 } else {
  138.                     $erro_envio = true;
  139.                 }
  140.             }
  141.         ?>
  142.         <?php if(!empty($email_enviado)) {
  143.                 echo "<script>alert('Contato enviado com sucesso! Agradecemos e retornaremos em breve.');</script>";
  144.                 echo '<script>location.href="index.php";</script>';
  145.             }
  146.             else {
  147.                 if (!empty($erro_envio)) {
  148.                     echo "<script>alert('Ocorreu algum erro, tente novamente mais tarde.');</script>";
  149.                     echo '<script>location.href="index.php";</script>';
  150.                 }
  151.             }
  152.         ?>
  153.         <section>
  154.             <div class="wrapper padding-default-top">
  155.                 <h1 class="section-title padding-default-top text-center wow fadeInDown">Contato</h1>
  156.                 <p class="section-subtitle text-center wow fadeInUp" data-wow-delay="0.2s">
  157.                     Fale com a gente, nos mande uma mensagem, tire suas dúvidas e nos siga em nossas redes sociais.
  158.                 </p>
  159.  
  160.                 <div class="row small-wrap padding-default-top">
  161.                     <div class="col-7 contact-form float-right">
  162.                         <div class="form">
  163.                             <div class="padding-small-bottom wow fadeInRight" data-wow-delay="0.6s">
  164.                                 <input name="form-nome" id="form-nome" type="text" placeholder="Seu nome" required>
  165.                             </div>
  166.                             <div class="padding-small-bottom wow fadeInRight" data-wow-delay="0.6s">
  167.                                 <input name="form-tel" id="form-tel" type="text" placeholder="Fone" required>
  168.                             </div>
  169.                             <div class="padding-small-bottom wow fadeInRight" data-wow-delay="0.6s">
  170.                                 <input name="form-assunto" id="form-assunto" type="text" placeholder="Assunto" required>
  171.                             </div>
  172.                             <div class="padding-small-bottom wow fadeInRight" data-wow-delay="0.6s">
  173.                                 <textarea name="form-mensagem" id="form-mensagem" cols="30" rows="10" placeholder="Sua mensagem" required></textarea>
  174.                             </div>
  175.                             <div class="text-center padding-small-top wow fadeInUp" data-wow-delay="0.8s"> 
  176.                                 <button class="button" type="submit">Enviar</button>
  177.                             </div>
  178.                         </div>
  179.                     </div>
  180.                     <div class="col-5 float-left contact-info">
  181.                         <strong class="wow fadeInLeft" data-wow-delay="0.4s">Endereço</strong>
  182.                         <p class="wow fadeInLeft" data-wow-delay="0.4s">
  183.                             Emp. Epitácio Pessoa<br/>
  184.                             Av Epitácio Pessoa - João Pessoa PB
  185.                         </p>
  186.                         <strong class="wow fadeInLeft" data-wow-delay="0.4s">Telefones</strong>
  187.                         <p class="wow fadeInLeft" data-wow-delay="0.4s">
  188.                             +55 83 3031.4432 / +55 83 3031.3212<br/>
  189.                             +55 83 9921.2111
  190.                         </p>
  191.  
  192.                         <strong class="wow fadeInLeft" data-wow-delay="0.6s">Siga-nos</strong>
  193.                         <a href="#" class="wow fadeInLeft" data-wow-delay="0.6s">
  194.                             <img src="<?php bloginfo('template_directory'); ?>/img/ic-facebook2.svg" data-wow-delay="0.6s" alt="">
  195.                         </a>
  196.                         <a href="#" class="wow fadeInLeft" data-wow-delay="0.6s">
  197.                             <img src="<?php bloginfo('template_directory'); ?>/img/ic-twitter2.svg" alt="">
  198.                         </a>
  199.                         <a href="#" class="wow fadeInLeft" data-wow-delay="0.6s">
  200.                             <img src="<?php bloginfo('template_directory'); ?>/img/ic-instagram2.svg" alt="">
  201.                         </a>
  202.                     </div>
  203.                 </div>
  204.             </div>
  205.         </section>
  206.         </form>
  207.     </div>
Add Comment
Please, Sign In to add comment