Created
March 13, 2017 21:45
-
-
Save staycreativedesign/2c47c3abd7319edf3bdbff8997b8dcb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='container'> | |
<div class='form ptb'> | |
<div class='row'> | |
<div class='col-12 col-sm-8 offset-sm-2'> | |
<p class='contact-area'></p> | |
<p class='no-pb'> | |
submit your request | |
</p> | |
<h1> | |
We will contact you soon | |
</h1> | |
</div> | |
</div> | |
<div class='row'> | |
<div class='col-12 col-sm-8 offset-sm-2'> | |
<form action="<?php the_permalink(); ?>" method="post"> | |
<div class='form-group'> | |
<input class="form-control" placeholder='NAME' name="name" value="<?php echo esc_attr($_POST['name']); ?>"> | |
</div> | |
<div class='form-group'> | |
<input class="form-control" placeholder='PHONE' name="phone" value="<?php echo esc_attr($_POST['phone']); ?>"> | |
</div> | |
<div class='form-group'> | |
<input class="form-control" placeholder='EMAIL' name="email" value="<?php echo esc_attr($_POST['email']); ?>"> | |
</div> | |
<div class='form-group'> | |
<input class="form-control" placeholder='DATE NEEDED' name="dates" value="<?php echo esc_attr($_POST['dates']); ?>"> | |
</div> | |
<div class='form-group'> | |
<textarea class="form-control" placeholder='REQUEST DETAILS' name="dates" rows='10' value="<?php echo esc_attr($_POST['details']); ?>"></textarea> | |
</div> | |
<div class='form-group'> | |
<button style="border:none;background:none;" value="submit" name="sub" id="sub"> | |
<img class='button-image' src='/wp-content/themes/rose-rock/images/assets/submit.png'> | |
</button> | |
</div> | |
</form> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* Template Name: Contact us */ ?> | |
<?php | |
$email = "[email protected]"; | |
//response messages | |
//user posted variables | |
//php mailer variables | |
$headers = | |
'From: '. $email . "\r\n" . | |
'Reply-To: ' . $email . "\r\n"; | |
if(isset($_POST['sub'])){ | |
wp_mail("[email protected]", "Someone has contacted you by the website", "this is a test", $headers); | |
}; | |
?> | |
<?php get_header(); ?> | |
<?php if (have_posts()) : ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<?php the_content(); ?> | |
<?php get_template_part('inc/contact-form'); ?> | |
<?php endwhile; ?> | |
<?php else : ?> | |
<?php get_template_part('inc/gone'); ?> | |
<?php endif; ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment