matthew_montgomery Posted March 5, 2010 Share Posted March 5, 2010 I keep getting the Parse error: syntax error, unexpected T_STRING in /home/content/e/d/g/edgeofamerica/html/src/sendorder.php on line 49 I have looked through my code and there were no obvious errors. As I am fairly new to this, can someone else give me a hand? <?php $m1 = $_POST['m1']; $m2 = $_POST['m2']; $e1 = $_POST['e1']; $e2 = $_POST['e2']; $pc = $_POST['pc']; $br = $_POST['br']; $cn = $_POST['cn']; $fn = $_POST['fn']; $bld = $_POST['bld']; $eld = $_POST['eld']; if (eregi('http:', $bld)) { die ("Naughty Naughty! "); } if(!$e1 == "" && (!strstr($e1,"@") || !strstr($e1,"."))) { echo "<h2>Error - Enter valid e-mail</h2>\n"; $badinput = "<h2>Form Not Sent</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($m1) || empty($e1) || empty($bld )) { echo "<h2>Error - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $m1 = $m1; $subject = $m1; $cn = stripcslashes($cn); $message = " $todayis [EST] \n Main Tenanat Name : $m1 \n Secondary Tenant Name: $m2 \n Primary Tenant Email: $m1 ($e1)\n Secondary Tenant Email: $e2 \n Property Code: $pc Bedrooms: $br Coordinator Name: $cn \n Firm Name: $fn \n Begin Lease Date: $bld \n End Lease Date: $eld \n $from = "From: $m1\r\n"; mail("[email protected],", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $m1 ?> ( <?php echo $e1 ?> ) <hr /> </p> Thanks. Matthew Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 5, 2010 Share Posted March 5, 2010 You are missing a closing double-quote and a semi-colon on the following line - End Lease Date: $eld \n Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1021949 Share on other sites More sharing options...
matthew_montgomery Posted March 5, 2010 Author Share Posted March 5, 2010 Do I need to add them to all of those, I noticed that none of the options have those, it worked great before. Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1021951 Share on other sites More sharing options...
greatstar00 Posted March 5, 2010 Share Posted March 5, 2010 you forgot the close the " before $from use text editor with programming highlight feature or else, u will get your self a big head Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1021958 Share on other sites More sharing options...
matthew_montgomery Posted March 5, 2010 Author Share Posted March 5, 2010 I noticed that, and still nothing. I tried many things and I continually get the same error. Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1021967 Share on other sites More sharing options...
PFMaBiSmAd Posted March 5, 2010 Share Posted March 5, 2010 If you add the two missing elements that I stated the syntax error will be fixed. Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1021969 Share on other sites More sharing options...
freakstyle Posted March 6, 2010 Share Posted March 6, 2010 The solution has been given a few times. here's the updated code for you to just copy and paste. that error will be removed, can't account for any other errors you may have, but that specific one you mentioned is easily resolved by one character added to the end of line 49. <?php $m1 = $_POST['m1']; $m2 = $_POST['m2']; $e1 = $_POST['e1']; $e2 = $_POST['e2']; $pc = $_POST['pc']; $br = $_POST['br']; $cn = $_POST['cn']; $fn = $_POST['fn']; $bld = $_POST['bld']; $eld = $_POST['eld']; if (eregi('http:', $bld)) { die ("Naughty Naughty! "); } if(!$e1 == "" && (!strstr($e1,"@") || !strstr($e1,"."))) { echo "<h2>Error - Enter valid e-mail</h2>\n"; $badinput = "<h2>Form Not Sent</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($m1) || empty($e1) || empty($bld )) { echo "<h2>Error - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $m1 = $m1; $subject = $m1; $cn = stripcslashes($cn); $message = " $todayis [EST] \n Main Tenanat Name : $m1 \n Secondary Tenant Name: $m2 \n Primary Tenant Email: $m1 ($e1)\n Secondary Tenant Email: $e2 \n Property Code: $pc Bedrooms: $br Coordinator Name: $cn \n Firm Name: $fn \n Begin Lease Date: $bld \n End Lease Date: $eld \n" $from = "From: $m1\r\n"; mail("[email protected],", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $m1 ?> ( <?php echo $e1 ?> ) <hr /> </p> Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1022171 Share on other sites More sharing options...
Tazerenix Posted March 6, 2010 Share Posted March 6, 2010 the above code will still return a T_STRING error because there is no semicolon This code should work: <?php $m1 = $_POST['m1']; $m2 = $_POST['m2']; $e1 = $_POST['e1']; $e2 = $_POST['e2']; $pc = $_POST['pc']; $br = $_POST['br']; $cn = $_POST['cn']; $fn = $_POST['fn']; $bld = $_POST['bld']; $eld = $_POST['eld']; if (eregi('http:', $bld)) { die ("Naughty Naughty! "); } if(!$e1 == "" && (!strstr($e1,"@") || !strstr($e1,"."))) { echo "<h2>Error - Enter valid e-mail</h2>\n"; $badinput = "<h2>Form Not Sent</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($m1) || empty($e1) || empty($bld )) { echo "<h2>Error - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $m1 = $m1; $subject = $m1; $cn = stripcslashes($cn); $message = " $todayis [EST] \n Main Tenanat Name : $m1 \n Secondary Tenant Name: $m2 \n Primary Tenant Email: $m1 ($e1)\n Secondary Tenant Email: $e2 \n Property Code: $pc Bedrooms: $br Coordinator Name: $cn \n Firm Name: $fn \n Begin Lease Date: $bld \n End Lease Date: $eld \n"; $from = "From: $m1\r\n"; mail("[email protected],", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $m1 ?> ( <?php echo $e1 ?> ) <hr /> </p> Quote Link to comment https://forums.phpfreaks.com/topic/194256-php-t-string-error/#findComment-1022176 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.