ebryant77 Posted January 15, 2010 Share Posted January 15, 2010 I am TOTALLY NEW to php, and blindly trying to figure this out. (When I say new I mean NEW so if you reply please keep in mind that I KNOW ALMOST NOTHING haha). I need to get this entry form posted asap, but I am lost. I copied the code from another (working) online info request form, but this one does not work. I get the error: Parse error: syntax error, unexpected T_STRING in /u/vp/cleanairlawncare.com/www/opp2010.php on line 110 I have been over the code so many times I am going crazy. Any help would be greatly appreciated!! Here is the code (also attached): <?php // Field Mapping $sName = $_POST["txtName"]; $scity = $_POST["txtCity"]; $sState = $_POST["selState"]; $sEmailAddress = $_POST["txtEmailAddress"]; $sZipCode = $_POST["txtZip"]; $sPhoneNumber = $_POST["txtPhoneNumber"]; $sSubject = $_POST["selSubject"]; $sHear = $_POST["txtHear"]; $sComments = $_POST["txtComments"]; if (($sName == "") || ($sEmailAddress == "") || ($scity == "") || ($sState == "") || ($sPhoneNumber == "") || ($sHear == "")) { print('<span style="color:#ffffff; font-size:14px; font-family:Arial, Helvetica, sans-serif">Please complete the Form. <a style="color:#ffffff" href="contact.html" onClick="history.go(-1);">Click here to go back</a></span>'); } else { $sMailFrom = '[email protected]'; $sMailTo = '[email protected]'; $sMailSubject = 'Clean Air Lawn Care Website form'; $sMailBody = '<p>Clean Air Lawn Care - Franchise/Contact Form</p> Name: <b>' . $sName . '</b><br /> City: <b>' . $scity . '</b><br /> State: <b>' . $sState . '</b><br /> Email Address: <b>' . $sEmailAddress . '</b><br /> Zip Code: <b>' . $sZipCode . '</b><br /> Phone Number: <b>' . $sPhoneNumber . '</b><br /> Subject: <b>' . $sSubject . '</b><br /> How did you hear about us: <b>' . $sHear . '</b><br /> Comments: <b>' . $sComments . '</b><br />'; $sMailHeaders = "From: $sMailFrom\n"; $sMailHeaders .= "Content-Type: text/html; charset=iso-8859-1\r\n"; if (mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders)) { print('<span style="color:#CCFFFF; font-size:14px; font-family:Arial, Helvetica, sans-serif"><div align="center"><br /><br />Thank you, your information has been emailed!</div></span>'); } else { print('<span style="color:#CCFFFF; font-size:14px; font-family:Arial, Helvetica, sans-serif"><div align="center"><br /><br />Could not send e-mail, please contact the webmaster!</div></span>'); } } ?> [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/ Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 at line 102, change it by Why Deserving: ' . $sDeserve . '<br />'; Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/#findComment-995814 Share on other sites More sharing options...
ebryant77 Posted January 15, 2010 Author Share Posted January 15, 2010 Thanks Felex, I tried that, but now I get THIS error Parse error: syntax error, unexpected T_VARIABLE in /u/vp/cleanairlawncare.com/www/opp2010.php on line 105 Code now reads: <?php // Field Mapping $sFirstName = $_POST["txtFirstName"]; $sLastName = $_POST["txtLastName"]; $sEmailAddress = $_POST["txtEmailAddress"]; $sPhoneNumber = $_POST["txtPhoneNumber"]; $sCity = $_POST["txtCity"]; $sState = $_POST["selState"]; $sOwnCity = $_POST["txtOwnCity"]; $sOwnState = $_POST["selOwnState"]; $sWhy = $_POST["txtWhy"]; $sView = $_POST["txtView"]; $sBusiness = $_POST["txtBusiness"]; $sDescribe = $_POST["txtDescribe"]; $sDeserve = $_POST["txtDeserve"]; $sTerms = $_POST["Terms"]; if (($sFirstName == "") || ($sLastName == "") || ($sEmailAddress == "") || ($sPhoneNumber == "") || ($sCity == "") || ($sState == "") || ($sOwnCity == "") || ($sOwnState == "") || ($sWhy == "") || ($sView == "") || ($sBusiness == "") || ($sDescribe == "") || ($sDeserve == "") || ($sTerms == "")) { print('<span style="color:#ffffff; font-size:14px; font-family:Arial, Helvetica, sans-serif">Please complete the Form. <a style="color:#ffffff" href="contact.html" onClick="history.go(-1);">Click here to go back</a></span>'); } else { $sMailFrom = '[email protected]'; $sMailTo = '[email protected]'; $sMailSubject = 'Clean Air Lawn Care Opportunity 2010'; $sMailBody = '<p>Clean Air Lawn Care - Opportunity 2010</p> First Name: <b>' . $sFirstName . '</b><br /> Last Name: <b>' . $sLastName . '</b><br /> Email Address: <b>' . $sEmailAddress . '</b><br /> Phone Number: <b>' . $sPhoneNumber . '</b><br /> City: <b>' . $sCity . '</b><br /> State: <b>' . $sState . '</b><br /> Franchise City: <b>' . $sOwnCity . '</b><br /> Franchise State: <b>' . $sOwnState . '</b><br /> Why do you want it: ' . $sWhy . '<br /> View on Sustainability: ' . $sView . '<br /> Business Experience: ' . $sBusiness . '<br /> Describe Yourself: ' . $sDescribe . '<br /> Why Deserving: ' . $sDeserve . '<br />' $sMailHeaders = "From: $sMailFrom\n"; $sMailHeaders .= "Content-Type: text/html; charset=iso-8859-1\r\n"; if (mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders)) { print('<span style="color:#CCFFFF; font-size:14px; font-family:Arial, Helvetica, sans-serif"><div align="center"><br /><br />Thank you, your information has been emailed!</div></span>'); } else { print('<span style="color:#CCFFFF; font-size:14px; font-family:Arial, Helvetica, sans-serif"><div align="center"><br /><br />Could not send e-mail, please contact the webmaster!</div></span>'); } } ?> Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/#findComment-995818 Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 dont forget ; at the end of the line Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/#findComment-995827 Share on other sites More sharing options...
ebryant77 Posted January 15, 2010 Author Share Posted January 15, 2010 THANK YOU FELEX...It worked! I wish I had thought to ask sooner and I greatly appreciate your time and expertise!! Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/#findComment-995836 Share on other sites More sharing options...
piyush23424 Posted January 15, 2010 Share Posted January 15, 2010 Put the single quote ( ' ) at the end of line no 106 but before semicolon Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/#findComment-995843 Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 your welcome mate, i am glad to help you Link to comment https://forums.phpfreaks.com/topic/188624-total-php-newbie-parse-error-syntax-error-unexpected-t_string/#findComment-995849 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.