Hey guys. I'm a real newbie to PHP. I'm trying to create a simple script to just send the email and give them a summary of what they wrote. However, I'm getting the following error, and I don't know what to do. Help would be much appreciated!
Parse error: syntax error, unexpected T_ECHO in C:\wamp\www\Glenwick Yard Services\email.php on line 48
(Line 48 is labeled and bolded)
<?php
// Create shorthand for the form data
$firstname = $_REQUEST['firstname'];
$lastname = $_REQUEST['lastname'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['text'];
// Check form Submission
if (isset($_POST["submitted"])) {
// Minimal Form Submission
if (!empty($_POST['firstname']) &&
!empty($_POST['lastname']) &&
!empty($_POST['email']) &&
!empty($_POST['text']) ) {
// Create the Body (format of Email)
$body = "First Name:
{$_POST['firstname']}\n\nLast Name:
{$_POST['lastname']}\n\nEmail:
{$_POST['email']}\n\nComments:
{$_POST['text']}";
// Make it no longer than 70 characters long (WordWrap)
$body = wordwrap($body, 70);
// Send the Email
mail('glenwickyardservice@gmail.com', 'Contact Form Submission', $body, "From: {$_POST['email']}")
// Print a Message
LINE 48 echo '<p><em>Thank you for contacting us, <b>$firstname</b>! We will respond to you within 12 hours at <b>$email</b></em></p>';
// Clear $_POST so that the form's not sticky
$_POST = array();
} else {
echo '<p style="font-weight: bold; color: #C00">Oops! You forgot to fill out some information! We would like to remind you that no information will be shared with anyone!</p>';
}
}
?>
I know you guys are very advanced at this stuff, and I feel a little dumb, but I just can't figure it out! Thanks...