Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKent Hefley
11,217 PointsGetting a form set up with PHPmailer
I am trying to get a contact form (with server side validation) on a website I am building set up to use phpmailer. I have tried going through a few of the php tutorials here with basic websites and just cannot quite grasp how to properly set this up.
I currently have the contact page as an html file. I have tried setting this up using both a php file as the contact page and an html file where the form action points to a separate php file that processes the information. I can't even seem to get the form to collect the data. I know very little about php.
Can someone help me get on the right path?
Here is my contact page markup
<!DOCTYPE html>
<html>
<head>
<title>Intrepid Waterless Powerwashing Systems Demos</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<header class="main-header group">
<div class="graphic">
<img class="main-logo" src="img/intrepidlogo2.svg" alt="Intrepid">
</div>
<nav class="main-nav group">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="demos.html">Demos</a></li>
<li id="active"><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<div class="demowrapper group">
<div class="formset">
<p class="conpar"><b>Please contact us with any questions you may have. We will be happy to supply additional information.
You can also call us direct at <a href="tel:1-800-424-2278">1-800-424-2278</a>.</b></p>
<img src="img/contactus.png" class="conimage" alt="contact us">
<form class="group" action="contact.php" method="post">
<h1 class="formh1">Contact Us</h1>
<fieldset>
<legend><span class="number">1</span></span>Your Basic Info</legend>
<label for="name">*Name:</label>
<input type="text" id="name" name="user_name">
<label for="mail">*Email:</label>
<input type="email" id="mail" name="user_email">
<label for="telephone">Telephone Number:</label>
<input type="tel" id="telephone" name="user_telephone">
</fieldset>
<fieldset>
<legend><span class="number">2</span></span>*What's On Your Mind?</legend>
<label for="bio">Message:</label>
<textarea id="bio" name="message"></textarea>
<label>*What is 2+2?</label>
<input name="human" placeholder="Type Here">
</fieldset>
<button type="submit" name="contact_submit">Submit</button>
</form>
</div>
</div>
<footer class="main-footer group">
<h4>© 2016 Intrepid Waterless Powerwashing Systems</h4>
<p>CAPCOR USA</p>
<div class="twitter-roll social-roll"></div>
<div class="youtube-roll social-roll"></div>
</footer>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.maskedinput.js" type="text/javascript"></script>
<script> jQuery(function($){
$("#telephone").mask("(999) 999-9999");
});
</script>
</body>
</html>
I also have the site on a temp server. http://intrepidtest.x10host.com/index.html
any help would be greatly appreciated.