Jump to content

Parse error -- simply can't figure it out -- have searched for hours


careym1989

Recommended Posts

I get this parse error when I try and submit my form:

 

Parse error: parse error, unexpected T_STRING, expecting ']' in /xx/xx/xx/xx/process_MeetandGreet.php on line 167

 

Here is my code for the form page:

 

				<form method="POST" action="process_MeetandGreet.php">
				<table border="0" width="100%" cellspacing="0" cellpadding="0">
					<tr>
						<td width="139" align="right"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">Name</span></font></td>
						<td width="5" align="left"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">:</span></font></td>
						<td>
						<input type="text" name="name" size="32" style="font-family: Arial; font-size: 8pt"></td>
					</tr>
					<tr>
						<td width="139" align="right"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">Email 
						Address</span></font></td>
						<td width="5" align="left"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">:</span></font></td>
						<td>
						<input type="text" name="email" size="32" style="font-family: Arial; font-size: 8pt"></td>
					</tr>
					<tr>
						<td width="139" align="right"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">Phone 
						Number </span></font></td>
						<td width="5" align="left"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">:</span></font></td>
						<td>
						<input type="text" name="phone" size="32" style="font-family: Arial; font-size: 8pt"></td>
					</tr>
					<tr>
						<td width="139" align="right"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">Address</span></font></td>
						<td width="5" align="left"><font face="Arial">
						<span style="font-size: 8pt; font-weight:700">:</span></font></td>
						<td>
						<input type="text" name="address" size="51" style="font-family: Arial; font-size: 8pt"></td>
					</tr>
					</table>
				<p>* All fields are required.</p>
				<p><input type="hidden" value="1" name="mgyes"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
			</form>

 

Here is the code for the problem page (error line is commented):

 

<?php

// Request Variables from Previous Form

$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$address = $_REQUEST['address'];
$mgyes = $_REQUEST['mgyes'];

// Submit Letter to Roanoke Times if Checked

if (!empty($name) && !empty($email) && !empty($phone) && !empty($address)) {

if ($mgyes == '1') {

$Content = "{$_POST['name']} would like to host a Meet and Greet. Their information is below:\n
\n
{$_POST['name']}\n
{$_POST['address']}\n
{$_POST['phone']}\n
{$_POST['email']}\n\n
Please get back to them as soon as possible and schedule a date. Thank you!";

$Content2 = "Thank you, {$_POST['name']}, for setting up a meet and greet. Someone from our campaign staff will contact you
to get the most convenient date for your meet and greet. Let your friends know about setting up a meet and greet at our
website.\n\n\n
You submitted the form with this information:\n\n
{$_POST['name']}\n
{$_POST['address']}\n
{$_POST['phone']}\n
{$_POST['email]}\n\n
Regards,\n
Sam Rasoul for Congress";

$Subject = "Host a Meet and Greet";
$Subject2 = "Meet and Greet Confirmation";

mail('[email protected]', $Subject, $Content, "From: {$_POST['email']}";     // [color=red]ERROR LINE[/color]
mail($email, " $Subject2", $Content2, "From: [email protected]");

echo 'Your information was submitted to our campaign staff. Thank you so much.';

} else {

echo 'For some reason your information was not submitted to our campaign staff. Please go back and try again.';

}
} else {

echo 'Please make sure that you have filled out your name, address, phone number, and email address, please.';

}
?>

 

On the third to last line, there is a " ' " there, but you cannot see it for some reason.

 

Help would be appreciated.

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.