Jump to content

unexpected T-Variable error in line 49 ?


bumblebee

Recommended Posts

I'm new to PHP and I'm just trying to make a form send. here's my code. I don't know what's wrong please help !

 

<?php

/*Subject and Email Variables*/

$emailSubject = 'Inquiry';
    $emailAddress = '[email protected]';
    
/*Gathering Data Variables*/

$firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $contact = $_POST['contact'];
    $email = $_POST['email'];
    $newsletter = $_POST['newsletter'];
    $projects = $_POST['projects_'];
    $trippingSchedule = $_POST['tripping schedule'];
    $source = $_POST['source'];
    $agent = $_POST['agent'];
    $comments = $_POST['comments'];
    
    $body = <<<EOD
<br/><hr/><br/>
Firstname : $firstname<br/>
Lastname : $lastname<br/>
Contact: $contact<br/>
Email : $email<br/>
Newsletter : $newsletter<br/>
Projects : $projects<br/>
Tripping Schedule : $tripping schedule<br/>
Source : $source<br/>
Agent name : $agent<br/>
Additional Comments : $comments<br/>
EOD;

$headers = "From: $email\r\n";
    $headers .= "content-type: text/html\r\n\";
    $sucess = mail($emailAddress, $emailSubject, $body, $headers);
    
/* Results render as HTML*/

$theResults = <<<EOD
<html>
<body>
<h1>thank you</h1>
</body>
</html>
EOD;

echo "$theResults";

?>

Link to comment
https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/
Share on other sites

Hi

 

On this line

$headers .= "content-type: text/html\r\n\";

 

You are escaping the closing quote

 

Is there a reason for the slash before the "?

 

 

THANK YOU SO MUCH ! I LOVE YOU ! I THINK I WANNA MARRY YOU ! SO HAPPY ! YOU MADE ME CRY ! WAH ! THANK YOU

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.