bumblebee Posted September 14, 2011 Share Posted September 14, 2011 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 = 'inquiry@topazbranch.com'; /*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"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/ Share on other sites More sharing options...
Nodral Posted September 14, 2011 Share Posted September 14, 2011 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 "? Quote Link to comment https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/#findComment-1269233 Share on other sites More sharing options...
Maq Posted September 14, 2011 Share Posted September 14, 2011 In the future, please place OR tags around your code. Quote Link to comment https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/#findComment-1269234 Share on other sites More sharing options...
bumblebee Posted September 14, 2011 Author Share Posted September 14, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/#findComment-1269235 Share on other sites More sharing options...
Nodral Posted September 14, 2011 Share Posted September 14, 2011 Glad to be of help. Please mark as solved Quote Link to comment https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/#findComment-1269237 Share on other sites More sharing options...
premiso Posted September 14, 2011 Share Posted September 14, 2011 THANK YOU SO MUCH ! I LOVE YOU ! I THINK I WANNA MARRY YOU ! SO HAPPY ! YOU MADE ME CRY ! WAH ! THANK YOU All you have to do is bendover... *premiso unzips Quote Link to comment https://forums.phpfreaks.com/topic/247130-unexpected-t-variable-error-in-line-49/#findComment-1269256 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.