blackimpala

Estructura HTML formulario

Sep 24th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.49 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template for the contact page form data
  4.  * - Used within the loop
  5.  */
  6. ?>
  7.  
  8.  
  9. <?php
  10. // Get address defaults
  11. $c_addr_1 = get_post_meta(get_the_ID(), '_contact_addr_1', true);
  12. $c_addr_2 = get_post_meta(get_the_ID(), '_contact_addr_2', true);
  13. $c_addr = trim( $c_addr_1 . ' ' . $c_addr_2 );
  14.  
  15. // Get phone default
  16. $c_tel = get_post_meta(get_the_ID(), '_contact_phone', true);
  17.  
  18. // Get email default
  19. $c_email = get_post_meta(get_the_ID(), '_contact_email', true);
  20.  
  21. // Get text defaults
  22. $c_text_1 = get_post_meta(get_the_ID(), '_contact_text_1', true);
  23. $c_text_2 = get_post_meta(get_the_ID(), '_contact_text_2', true);
  24.  
  25. ?>
  26.  
  27.  
  28. <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  29.  
  30. <div class="container">
  31.   <div class="contact">
  32.     <div class="col-md-6 col-md-offset-3">
  33.       <div class="form-area">
  34.               <div class="text-center contact-h"><?php the_title();?></div>
  35.             <?php echo $response; ?>
  36.             <form id="contact-form" action="<?php the_permalink(); ?>" method="post">
  37.                   <div class="group form-group">
  38.                       <input class="form-control" id="name" type="text" name="message_name" value="<?php if (isset($_POST['message_name'])) { echo esc_attr($_POST['message_name']);} ?>">
  39.                       <span class="highlight"></span>
  40.                       <span class="bar"></span>
  41.                       <label for="name">Name</label>
  42.                   </div><!-- end div group form-group -->
  43.                   <div class="group form-group">
  44.                       <input class="form-control"  id="email" type="email" name="message_email" value="<?php if (isset($_POST['message_email'])) { echo esc_attr($_POST['message_email']);} ?>">
  45.                       <span class="highlight"></span>
  46.                       <span class="bar"></span>
  47.                       <label for="message_email">Email</label>
  48.                   </div><!-- end div group form-group -->
  49.                   <div class="group form-group">
  50.                       <input class="form-control"  id="phone" type="tel" name="message_phone" value="<?php if (isset($_POST['message_phone'])) { echo esc_attr( $_POST['message_phone']); } ?>">
  51.                       <span class="highlight"></span>
  52.                       <span class="bar"></span>
  53.                       <label for="message_phone">Phone</label>
  54.                   </div><!-- end div group form-group -->
  55.                   <div class="group form-group">
  56.                       <div class="text-group">
  57.                           <textarea class="form-control" type="text" name="message_text" rows="4"><?php if (isset($_POST['message_text'])) { echo esc_textarea($_POST['message_text']); } ?></textarea>
  58.                           <label for="message_text" class="input-label">Message</label>
  59.                           <i class="bar"></i>
  60.                       </div><!-- end div text-group -->
  61.                   </div><!-- end div group form-group -->
  62.                   <div class="g-recaptcha" data-sitekey="6Ld61NkUAAAAAJJ60gH6Ku38xJwj8nzKWbYiaecs"></div>
  63.                   <input type="hidden" name="submitted" value="custom_action">
  64.                   <?php wp_nonce_field( 'custom_action_nonce', 'gymclub_nonce_field' ); ?>
  65.                   <button class="btn btn-primary" id="submit" type="submit" id="gymclub-submit" name="submit">Send</button>
  66.             </form><!-- end form -->
  67.       </div><!--end respond -->
  68.    </div><!-- end div -->
  69.  </div><!-- end div contact -->
  70. </div><!-- end container -->
  71.  
Add Comment
Please, Sign In to add comment