Hi,
So recently I downloaded a template off the internet for the site, and it has a contact form in it but no way to set it up. After contacing the developer he linked me to a site, however, its not been all that useful as I still cannot get it to work. When I put anything in and press "Send Message" it just gives me this error: "Parse error: syntax error, unexpected T_STRING in /home/bdurodjc/public_html/Home/mail.php on line 5"
I'm unsure of what this means and what I can do to fix it. Also, the "Send Message" and "Clear Form" buttons are white and not green like they should be, I'd also like them to be on the same line but I couldn't figure out a way of doing this. Apologies for asking so much, the other thing is I don't know how to make it check that the email address is valid.
The website this is on is at: http://chocants.co.uk/Home/ and the approriate code is below.
index.html (Form)
<form action="mail.php" method="POST">
<div class="row half">
<div class="6u">
<input type="text" class="text" name="name" placeholder="Name">
</div>
<div class="6u">
<input type="text" class="text" name="email" placeholder="Email">
</div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<ul class="actions">
<li><input type="submit" class="button form" value="Send Message"><input type="reset" class="button form" value="Clear Form"></li>
</ul>
</div>
</div>
</form>
mail.php
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "jadon.mayhew@me.com<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
</script>";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
Thanks for any help :)