Character "$" is not allowed in prolog
John De Zon
13/03/2016 11:43:40Hallo iedereen,
Ik probeer om een mail te sturen met php maar ik krijg alleen platte tekst aan (met html code!).
Ik heb het dan door de W3C Markup Validator gehaald en ik krijg 3 errors:
Validation Output: 3 Errors
Error Line 1, Column 9: character "$" not allowed in prolog
$message = '<html><body>';
✉
Error Line 6, Column 9: character "$" not allowed in prolog
$message .= "<p>Subject: ".$_POST['subject']."</p>";
✉
Error Line 9, Column 38: end of document in prolog
$message .= '</html></body>';
✉
This error may appear when the validator receives an empty document. Please make sure that the document you are uploading is not empty, and report any discrepancy.
Mijn code:
Met vriendelijke groet
Ik probeer om een mail te sturen met php maar ik krijg alleen platte tekst aan (met html code!).
Ik heb het dan door de W3C Markup Validator gehaald en ik krijg 3 errors:
Validation Output: 3 Errors
Error Line 1, Column 9: character "$" not allowed in prolog
$message = '<html><body>';
✉
Error Line 6, Column 9: character "$" not allowed in prolog
$message .= "<p>Subject: ".$_POST['subject']."</p>";
✉
Error Line 9, Column 38: end of document in prolog
$message .= '</html></body>';
✉
This error may appear when the validator receives an empty document. Please make sure that the document you are uploading is not empty, and report any discrepancy.
Mijn code:
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
$message = '<html><body>';
$message .= "<p>Dear,</p>";
$message .= "<p>".$_POST['uname']." wants support!</p>";
$message .= "<p>Username: ".$_POST['uname']."</p>";
$message .= "<p>Mail: ".$_POST['mail']."</p>";
$message .= "<p>Subject: ".$_POST['subject']."</p>";
$message .= '<br />';
$message .= "<p><b>Message:</b></p><p>".$_POST['message']."</p>";
$message .= '</html></body>';
$message .= "<p>Dear,</p>";
$message .= "<p>".$_POST['uname']." wants support!</p>";
$message .= "<p>Username: ".$_POST['uname']."</p>";
$message .= "<p>Mail: ".$_POST['mail']."</p>";
$message .= "<p>Subject: ".$_POST['subject']."</p>";
$message .= '<br />';
$message .= "<p><b>Message:</b></p><p>".$_POST['message']."</p>";
$message .= '</html></body>';
Met vriendelijke groet