Skip to content

Instantly share code, notes, and snippets.

@martisj
Created May 3, 2013 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martisj/5507050 to your computer and use it in GitHub Desktop.
Save martisj/5507050 to your computer and use it in GitHub Desktop.
<?php
$action = (isset($_POST['__action'])) ? $_POST['__action'] : null; // is the action we have to take
$err = array(); // empty array to hold any processing errors
if($action){ // there is an action
if($action == 'email'){
// we must process the email form
require_once('send.php'); // require the file needed to process email form
}
}
function printError($msg){
echo "<span class='error'>{$msg}</span>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Come Alive Chiropractic - Contact Us</title>
<style type="text/css" media="screen">
@import "css/comealive_style.css";
</style>
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
filter: none;
}
</style>
<![endif]-->
</head>
<body>
<div class="wrapper">
<div class="gradient">
<div class="box">
<header>
<div class='container'>
<div id="logo">
<a href="index.html"><img src="images/Come_Alive_Logo.png" width="250" height="125" alt="Come Alive Chiropractic Logo" /></a>
</div>
</div>
</header>
<nav class="global current">
<ul class="list">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="patients.html">Patients</a></li>
<li><a href="rx4.html">Rx4</a></li>
<li><a class="active" href="contact.php">Contact Us</a></li>
</ul><!--end list-->
</nav><!--end global-->
<section id="content">
<aside id="right">
<div id="table">
<thead>
<table border="0" cell padding="5" cellspacing="5" width="50%">
<tr><th colspan="3" align="center" class="1">Office Hours</th></tr>
<div class"border">
<tr><th class="th-bg">Day</th><th class="th-bg">Open</th><th class="th-bg">Close</th></tr><!--ends border--></div>
<tr><td>Monday</td><td class="center">1:00 PM</td><td class="center">7:00 PM</td></tr></span>
<tr><td>Tuesday</td><td class="center">1:00 PM</td><td class="center">7:00 PM</td></tr>
<tr><td>Wednesday</td><td class="center">Closed</td><td class="center">Closed</td></tr>
<tr><td>Thursday</td><td class="center">1:00 PM</td><td class="center">7:00 PM</td></tr>
<tr><td>Friday</td><td class="center">12:00 PM</td><td class="center">6:00 PM</td></tr>
</thead>
</table>
<!--end table--></div>
<br>
<div id="contact-info">
<p><strong><em>Come Alive Chiropractic</em></strong><br>16 South Main Street<br>Manheim, PA 17545</p>
<p><strong><em>Telephone</em></strong><br>717-665-1888</p>
</div>
</aside><!--end right-->
<section id="main">
<h1 class="header">Contact Us</h1>
<article class="content-article">
<h2>Reach out to us for any questions you have.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet interdum lacus, ut malesuada enim ultrices vel. Curabitur vulputate condimentum consequat. Suspendisse eleifend dui at nisl adipiscing gravida. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris ligula elit, euismod eu sollicitudin ac, gravida in eros. Nunc suscipit volutpat eleifend. Donec ut ligula lacus, sit amet aliquam eros. Donec viverra purus suscipit eros pretium vitae convallis mauris mollis. Cras vulputate metus at odio pretium adipiscing. Cras iaculis odio quis massa gravida ullamcorper. Morbi vitae nunc quis ante lobortis pharetra.</p>
</article>
<section id="contact-form">
<?php if($action == email && ! $err): /* the form was submitted and there are no errors, thus the email send was successful */ ?>
<div style='color: green'>We have received your email, and you should receive a reply shortly! Thanks</div>
<?php else: /* the form was not submitted or there were errors, thus we need to display the form */ ?>
<div id="form">
<form name="myForm" action="" method="post">
<fieldset>
<legend>Send Us An Email!</legend>
<label for="name">Name:</label>
<input type="text" id="name" name="name" value="<?= (isset($_POST['name'])) ? $_POST['name'] : null ?>" />
<?php if(isset($err['name'])) printError($err['name']); ?>
<br />
<label for="email">Email:</label>
<input type="text" id="email" name="email" value="<?= (isset($_POST['email'])) ? $_POST['email'] : null ?>"/>
<?php if(isset($err['email'])) printError($err['email']); ?>
<br />
<label for="comments">Comments:</label>
<br />
<?php if(isset($err['comments'])){ printError($err['comments']); echo '<br />'; } ?>
<textarea id="comments" name="comments" rows="5" cols="30"><?= (isset($_POST['comments'])) ? $_POST['comments'] : null ?></textarea>
<br />
<br />
<form method="post" action="verify.php">
<?php
require_once('captcha/recaptchalib.php');
$publickey = "6LclzuASAAAAAMgRFHMig_Zv81_xKMskaMxSDhlG"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
<input type="submit" />
</form>
<button name='__action' value='email'>Send</button>
</fieldset>
</form>
</div><!--end form-->
<?php endif; ?>
</section>
</section><!--end main-->
</section><!--end content-->
</div><!--end box-->
<div id="footer-bg">
<div class="box">
<footer>
<section id="foot-container">
<nav id="courtesy">
<ul id="clist">
<li><a href="credits.html">Credits</a></li>
<li><a href="directions.html">Directions</a></li>
<li><a href="faq.html">FAQ</a></li>
<li><a href="links.html">Links</a></li>
<li><a href="privacy.html">Privacy Policy</a></li>
<li><a href="terms.html">Terms of Service</a></li>
</ul><!--end clist-->
</nav><!--end courtesy-->
<a href="https://www.facebook.com/pages/Come-Alive-Chiropractic/141512509228230"><img src="images/facebook.png" width="64" height="64" alt="Facebook"></a>
<div id="copyright">
<p>Copyright &copy; 2013 Come Alive Chiropractic. All Rights Reserved.<br />
Website Designed By <a href="http://www.innermindco.com" target="_blank">Inner Mind Co.</a></p>
</div><!--end copyright-->
</section><!--end foot-container-->
</footer><!--end footer-->
</div<!--end box-->
</div><!--end footer-bg-->
</div><!--end gradient-->
<div id="preloaded-images">
<img src="../images/btnPurple6.svg" width="1" height="1" alt="" />
<img src="../images/btnPurple3.svg" width="1" height="1" alt="" />
<img src="../images/btnPurple5.svg" width="1" height="1" alt="" />
</div>
</div><!--end wrapper-->
</body><!--end body-->
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment