I Followed a simple tutorial from mmtuts on YouTube and uploaded my html and php to my website at dougcannonbio.com, my website that I'm trying to make. Just starting out with a template before I put out any details to make sure that they all function.
Everything is looking great so far and now I'm having trouble just even trying to send anything from this text box to my email. Is this too much to ask for. What am I doing wrong? Am I missing something?
I'm just trying send to my email through this simple contact form using nothing but php.
HTML
<div class="form">
<input name="name" type="text" class="feedback-input" placeholder="Name" />
<input name="email" type="text" class="feedback-input" placeholder="Email" />
<input name="subject" type="text" class="feedback-input" placeholder="Subject" />
<textarea name="text" class="feedback-input" placeholder="Comment"></textarea>
<input type="submit" value="SUBMIT"/>
</div>
CSS
form { max-width:420px; margin:50px auto; }
.feedback-input {
color:white;
font-family: Helvetica, Arial, sans-serif;
font-weight:500;
font-size: 18px;
border-radius: 5px;
line-height: 22px;
background-color: transparent;
border:2px solid #CC6666;
transition: all 0.3s;
padding: 13px;
margin-bottom: 15px;
width:100%;
box-sizing: border-box;
outline:0;
}
.feedback-input:focus { border:2px solid #CC4949; }
textarea {
height: 150px;
line-height: 150%;
resize:vertical;
}
[type="submit"] {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
width: 100%;
background:#CC6666;
border-radius:5px;
border:0;
cursor:pointer;
color:white;
font-size:24px;
padding-top:10px;
padding-bottom:10px;
transition: all 0.3s;
margin-top:-4px;
font-weight:700;
}
[type="submit"]:hover { background:#CC4949; }
/* End contact form styling */
PHP
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['text'];
$mailTo = "contact@dougcannonbio.com";
$headers = "From: ".$email;
$comment = "You have received an email from ".$name.".\n\n".$comment;
mail($mailTo, $subject, $txt, $headers);
header("Location: index.php?mailsend");
}