Search code examples
phpcontact-formphp-parse-error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in


I'm new to coding and after hosting my site I got this error when checking to make sure my php contact form was working:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 16

the php code is:

<?php

$subject="subject";

$message="$message";

$mail_from="$email";

$header="from: $name <$mail_form>";

$to='[email protected]';

$send_contact=mail($to,$subject,$message,$header);

if($send_contact){
    echno "Thank You!" "<a href='index.html' style='text-decoration:none; color:#4fa9b8;'> Return Home </a>";
}
else{
    echno "ERROR";
}
?>

Any ideas on how I can fix this? Thank you in advance.


Solution

  • True format. echo instead of echno and fixed double quotes " "

    if($send_contact){
        echo "Thank You! <a href='index.html' style='text-decoration:none; color:#4fa9b8;'> Return Home </a>";
    } else {
        echo "ERROR";
    }