By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,810 Members | 783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,810 IT Pros & Developers. It's quick & easy.

parse error syntax error unexpected - using php sendmail

maxamis4
Expert 100+
P: 295
Hello folks,

Learning PHP here and I am using sendmail.php to send an email. I have setup my html contact form and I am using the following to send an email once a confirmation has been made:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3. $to = "johnDoe@hotmail.com";
  4. $tfirstName = $_REQUEST['fname'];
  5. $tlastName = $_REQUEST['lname'];
  6. $Zip = $_REQUEST['zip'];
  7. $ReqDate = $_REQUEST['ReqDate'];
  8. $EndDate = $_REQUEST['EndDate'];
  9. $DutyStation = $_REQUEST['txtPDS'];
  10. $TravPur = $_REQUEST['txtTDDS'];
  11. $TNumb1 = $_REQUEST['TN1'];
  12. $TNumb1 = $_REQUEST['TN2'];
  13. $TYPE1 = $_REQUEST['TypeOpt'];
  14. $TYPE2 = $_REQUEST['TypeOpt2'];
  15. $POV = $_REQUEST['POV'];
  16. $CAR = $_REQUEST['CAR'];
  17. $TRANS = $_REQUEST['TRANS'];
  18. $RIDE = $_REQUEST['Ride'];
  19. $COMM = $_REQUEST['txtComments'];
  20. $RfirstName = $_REQUEST['Rfname'];
  21. $RLastName = $_REQUEST['Rlname'];
  22. $SfirstName = $_REQUEST['Sfname'];
  23. $SLastName = $_REQUEST['Slname'];
  24. $SEmail = $_REQUEST['Semail'];
  25. $temail = $_REQUEST['TEmail'];
  26. $TravelNumber = date("YmdH:i a");
  27.  
  28. //$PNumber = $_REQUEST['Phone'];
  29.   //     if($PNumber != ""){ $strno=$PNumber; } else { $strno="-"; }    
  30. $subject = "NEW GITGO TRAVEL REQUEST:";
  31. $subject = &$TravelNumber;
  32.  
  33. $message = 'The Contacts Name is: '.$tfirstName.' '.$tlastName.;
  34.  
  35. $headers = "From: $email"; 
  36. $sent = mail($to, $subject, $message, $headers) ; 
  37. header( "Location: http://159.142.143.13/requests/thankyou.html" );
  38. if($sent) 
  39. {print "Your mail was sent successfully"; }
  40.  else 
  41. {print "We encountered an error sending your mail"; }
  42. ?> 
  43.  
however I keep getting the following error
Parse error: syntax error, unexpected ';' in C:\XAMPP\xampp\htdocs\Requests\sendmail.php on line 33

any links or help would be greatly appreciated.
Nov 2 '09 #1

✓ answered by Dormilich

although the error was caused by a "." …

Share this Question
Share on Google+
5 Replies


maxamis4
Expert 100+
P: 295
Please ignore I have it working. PHP is very case sensative.
Nov 2 '09 #2

Dormilich
Expert Mod 5K+
P: 8,639
although the error was caused by a "." …
Nov 2 '09 #3

maxamis4
Expert 100+
P: 295
Just one more questión How can i cc and Bcc people in this send script.
Nov 2 '09 #4

Dormilich
Expert Mod 5K+
P: 8,639
pass it to the headers parameter of mail()
Nov 2 '09 #5

Markus
Expert 5K+
P: 6,050
@maxamis4
php.net/mail - see example 4.
Nov 2 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.