0

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!";

Edited by Dani: Formatting fixed (Line numbers will be added automatically next time)

2
Contributors
2
Replies
17
Views
3 Years
Discussion Span
Last Post by Hannah Sibongile
0
<?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

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.