careym1989 Posted September 22, 2008 Share Posted September 22, 2008 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. Link to comment https://forums.phpfreaks.com/topic/125233-parse-error-simply-cant-figure-it-out-have-searched-for-hours/ Share on other sites More sharing options...
JasonLewis Posted September 22, 2008 Share Posted September 22, 2008 Check up... Up.. and Up... {$_POST['email]}\n\n Uh-oh! Error. Where is the ' ? Link to comment https://forums.phpfreaks.com/topic/125233-parse-error-simply-cant-figure-it-out-have-searched-for-hours/#findComment-647378 Share on other sites More sharing options...
F1Fan Posted September 22, 2008 Share Posted September 22, 2008 Missing close parenthesis: ) mail('[email protected]', $Subject, $Content, "From: {$_POST['email']})"; Link to comment https://forums.phpfreaks.com/topic/125233-parse-error-simply-cant-figure-it-out-have-searched-for-hours/#findComment-647380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.