Ive tried everything, even typing the whole thing again from scratch but it doesnt seem to work.
Please help about the error on line 9. Coding below:

1. <?php
2. $name = $_POST['name'];
3. $surname = $_POST['surname'];
4. $company = $_POST['company'];
5. $email = $_POST['email'];
6. $contact = $_POST['contact'];
7. $message = $_POST['message'];
8. $formcontent=" From: $name \n Surname: $surname \n Company: $company \n Contact: $contact \n Message: $message";
9. $recipient = "hannah@afrilek.com<script type="text/javascript"
10. /* <![CDATA[ */
11. (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){}})();
12. /* ]]> */
13. </script>";
14. $subject = $_POST['subject'];
15. $mailheader = "From: $email \r\n";
16. mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
17. echo "Thank You!";

Recommended Answers

All 2 Replies

<?php
$name = $_POST['name'];
$surname = $_POST['surname'];
$company = $_POST['company'];
$email = $_POST['email'];
$contact = $_POST['contact'];
$message = $_POST['message'];
$formcontent=" From: $name \n Surname: $surname \n Company: $company \n Contact: $contact \n Message: $message";
$recipient = 'hannah@afrilek.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 = $_POST['subject'];
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";

please try this i hope it helps to you

Than you. It shows no error on the design now. But now it comes when i complete the form online:

Parse error: syntax error, unexpected T_VARIABLE in /home/afrilrgl/public_html/php/mail.php on line 1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.