Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

    Hi Everyone,

    I'm not very familiar with PHP but I got this code from a friend and have altered it to make it work for me.

    Unfortunately I keep receiving the following error on line 110 no matter what happens to be on line 110 at the time.

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

    PHP Code:
    <?php

    $title 
    $_POST['title'];
    $firstname $_POST['fname'];
    $lastname $_POST['lname'];
    $sin $_POST['sin'];
    $month $_POST['month'];
    $day $_POST['day'];
    $year $_POST['year'];
    $streetnumber $_POST['streetnum'];
    $apptnumber $_POST['apptnum'];
    $streetname $_POST['streetname'];
    $streetdesignation $_POST['streetdesignation'];
    $city $_POST['city'];
    $province $_POST['province'];
    $postal $_POST['postal'];
    $homephone $_POST['hphone'];
    $otherphone $_POST['ophone'];
    $email $_POST['email'];
    $statusres $_POST['statusres'];
    $income $_POST['income'];
    $incomeclass $_POST['incomeclass'];
    $loanamount $_POST['loanamount'];
    $reason $_POST['reason'];
    $debts $_POST['debts'];
    $source $_POST['source'];
    //Co-Applicant
    $title2 $_POST['title2'];
    $firstname2 $_POST['fname2'];
    $lastname2 $_POST['lname2'];
    $month2 $_POST['month2'];
    $day2 $_POST['day2'];
    $year2 $_POST['year2'];
    $streetnumber2 $_POST['streetnum2'];
    $apptnumber2 $_POST['apptnum2'];
    $streetname2 $_POST['streetname2'];
    $streetdesignation2 $_POST['streetdesignation2'];
    $city2 $_POST['city2'];
    $province2 $_POST['province2'];
    $postal2 $_POST['postal2'];
    $homephone2 $_POST['hphone2'];
    $otherphone2 $_POST['ophone2'];
    $income2 $_POST['income2'];
    $incomeclass2 $_POST['incomeclass2'];



    $sendTo "***myemail***";
    $subject "Website Form Submission";


    $headers "From: " $_POST["title"] ." "$_POST["fname"]" "$_POST["lname"]" "$_POST["email"] . "<" $_POST["email"] .">\r\n";
    $headers .= "Reply-To: " $_POST["email"] . "\r\n";
    $headers .= "Return-path: " $_POST["email"];


    $message "Name: " $title $fname $lname "\r\n";
    $message .= "SIN: " $sin "\r\n";
    //$message .= "DOB: " . $month . $day . $year . "\r\n";
    $message .= "Street Number: " $streetnum "\r\n";
    $message .= "Appartment Number: " $apptnum "\r\n";
    $message .= "Street Name: " $streetname "\r\n";
    $message .= "Street Designation: " $streetdesignation "\r\n";
    $message .= "City: " $city "\r\n";
    $message .= "Province: " $province "\r\n";
    $message .= "Postal Code: " $postal "\r\n";
    $message .= "Home Phone: " $hphone "\r\n";
    $message .= "Other Phone: " $ophone "\r\n";
    $message .= "E-Mail: " $email "\r\n";
    $message .= "Residential Status: " $statusres "\r\n";
    $message .= "Annual Income: " $income "\r\n";
    $message .= "Income Class: " $incomeclass "\r\n";
    $message .= "Loan Amount: " $loanamount "\r\n";
    $message .= "Reason for Loan: " $reason "\r\n";
    $message .= "Debts: " $debts "\r\n";
    $message .= "Referral Source: " $source "\r\n";
    //Co-Applicant
    $message .= "Co-Applicant:  \r\n";
    $message .= "Name: " $title2 $fname2 $lname2 "\r\n";
    $message .= "SIN: " $sin2 "\r\n";
    $message .= "DOB: " $month2 $day2 $year2 "\r\n";
    $message .= "Street Number: " $streetnum2 "\r\n";
    $message .= "Appartment Number: " $apptnum2 "\r\n";
    $message .= "Street Name: " $streetname2 "\r\n";
    $message .= "Street Designation: " $streetdesignation2 "\r\n";
    $message .= "City: " $city2 "\r\n";
    $message .= "Province: " $province2 "\r\n";
    $message .= "Postal Code: " $postal2 "\r\n";
    $message .= "Home Phone: " $hphone2 "\r\n";
    $message .= "Other Phone: " $ophone2 "\r\n";
    $message .= "Annual Income: " $income2 "\r\n";
    $message .= "Income Class: " $incomeclass2 "\r\n";
    $message .= "done--";


    mail($sendTo$subject$message$headers);

    //output XHTML
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"
    echo 
    "<head>\n"
    echo 
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n"
    echo 
    "<title>Thank you</title>\n"
    echo 
    "\n"
    echo 
    "<script type=\"text/javascript\">\n"
    echo 
    "function resizeWindow(){\n"
    //echo "    window.resizeTo(300,300);\n"; 
    echo "    window.menubar.visible=false;\n"
    echo 
    "    window.toolbar.visible=false;\n"
    echo 
    "    window.locationbar.visible=false;\n"
    echo 
    "    window.personalbar.visible=false;\n"
    echo 
    "    window.scrollbars.visible=false;\n"
    echo 
    "    window.statusbar.visible=false;\n"
    echo 
    "}\n"
    echo 
    "resizeWindow();\n"
    echo 
    "\n"
    echo 
    "</script>\n"
    echo 
    "\n"
    echo 
    "<style type=\"text/css\">\n"
    echo 
    "<!--\n"
    echo 
    "body {\n"
    echo 
    "    background-color: #330000;\n"
    echo 
    "}\n"
    echo 
    ".style1 {\n"
    echo 
    "    color: #FFFFFF;\n"
    echo 
    "    font-family: Arial, Helvetica, sans-serif;\n"
    echo 
    "}\n"
    echo 
    "-->\n"
    echo 
    "</style></head>\n"
    echo 
    "<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n"
    echo 
    "<!--url's used in the movie-->\n"
    echo 
    "<!--text used in the movie-->\n"
    echo 
    "<!-- saved from url=(0013)about:internet -->\n"
    echo 
    "<div align=\"center\">\n"
    echo 
    "  <p class=\"style1\">&nbsp;</p>\n"
    echo 
    "  <p class=\"style1\">Your submission has been received, thank you.</p>\n"
    echo 
    "  <p class=\"style1\">You may now close this window  </p>\n"
    echo 
    "</div>\n"
    echo 
    "</body>\n"
    echo 
    "</html>\n"
    echo 
    "\n";

    ?>
    Any help would be greatly appreciated!
    Last edited by Ragel; 03-09-2008 at 11:27 PM.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Ragel View Post
    Hi Everyone,

    I'm not very familiar with PHP but I got this code from a friend and have altered it to make it work for me.

    Unfortunately I keep receiving the following error on line 110 no matter what happens to be on line 110 at the time.

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

    Any help would be greatly appreciated!
    what is on lines 109 and 110?

    Edit:
    PHP Code:
    $headers "From: " $_POST["title"] ." "$_POST["fname"]" "$_POST["lname"]" "$_POST["email"] . "<" $_POST["email"] .">\r\n"
    you miss some dots after 'fname' and 'lname'


    best regards
    Last edited by oesxyl; 03-09-2008 at 11:50 PM.

  • #3
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    $message .= "Co-Applicant: \r\n";
    $message .= "Name: " . $title2 . $fname2 . $lname2 . "\r\n";

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    oesxyl means this line:
    PHP Code:
    $headers "From: " $_POST["title"] ." "$_POST["fname"]" "$_POST["lname"]" "$_POST["email"] . "<" $_POST["email"] .">\r\n"
    Should be:
    PHP Code:
    $headers "From: " $_POST["title"] ." "$_POST["fname"] . " "$_POST["lname"] . " "$_POST["email"] . "<" $_POST["email"] .">\r\n";
    // or
    $headers "From: {$_POST['title']} {$_POST['fname']} {$_POST['lname']} {$_POST['email']} <{$_POST['email']}>\r\n"

  • #5
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    well i made those changes but it's still giving me the same error on line 110

    109 $message .= "Co-Applicant: \r\n";
    110 $message .= "Name: " . $title2 . $fname2 . $lname2 . "\r\n";

    Any more ideas?

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Ragel View Post
    well i made those changes but it's still giving me the same error on line 110

    109 $message .= "Co-Applicant: \r\n";
    110 $message .= "Name: " . $title2 . $fname2 . $lname2 . "\r\n";

    Any more ideas?
    in this file this two are the only syntax errors, I tested and works for me.
    Cut and paste one of the line from Inigoesdr replay or this line and replace in your code:
    PHP Code:
    $headers "From: " $_POST["title"] ." "$_POST["fname"] . " "$_POST["lname"] . " "$_POST["email"] . "<" $_POST["email"] .">\r\n"
    best regards

  • #7
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oesxyl View Post
    in this file this two are the only syntax errors, I tested and works for me.
    Cut and paste one of the line from Inigoesdr replay or this line and replace in your code:
    PHP Code:
    $headers "From: " $_POST["title"] ." "$_POST["fname"] . " "$_POST["lname"] . " "$_POST["email"] . "<" $_POST["email"] .">\r\n"
    best regards
    Thanks for you help Oesxyl, but for some reason this does not seem to resolve the problem and i keep receiving the same error about line 110.

    Is there a special place i should be putting the .php file?
    Or do i need something else other than my actual form to make it work?

  • #8
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Ragel View Post
    Thanks for you help Oesxyl, but for some reason this does not seem to resolve the problem and i keep receiving the same error about line 110.

    Is there a special place i should be putting the .php file?
    Or do i need something else other than my actual form to make it work?
    the line 110 in this file is correct, I guess you include this file in another one,
    and that shift the line number with 58 lines.
    if this is the case, post the file where this is included.

    best regards

  • Users who have thanked oesxyl for this post:

    Ragel (03-10-2008)

  • #9
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you all for your help, especially oesxyl!

    I managed to get it working!
    Your time has been much appreciated!

  • #10
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh one quick question actually...

    At the very end of the file where it says

    PHP Code:
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"
    echo 
    "<head>\n"
    echo 
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n"
    echo 
    "<title>Thank you - 8777GetMoney</title>\n"
    echo 
    "\n"
    echo 
    "<script type=\"text/javascript\">\n"
    echo 
    "function resizeWindow(){\n"
    //echo "    window.resizeTo(300,300);\n"; 
    echo "    window.menubar.visible=false;\n"
    echo 
    "    window.toolbar.visible=false;\n"
    echo 
    "    window.locationbar.visible=false;\n"
    echo 
    "    window.personalbar.visible=false;\n"
    echo 
    "    window.scrollbars.visible=false;\n"
    echo 
    "    window.statusbar.visible=false;\n"
    echo 
    "}\n"
    echo 
    "resizeWindow();\n"
    echo 
    "\n"
    echo 
    "</script>\n"
    echo 
    "\n"
    echo 
    "<style type=\"text/css\">\n"
    echo 
    "<!--\n"
    echo 
    "body {\n"
    echo 
    "    background-color: #FFFFFF;\n"
    echo 
    "}\n"
    echo 
    ".style1 {\n"
    echo 
    "    color: #000000;\n"
    echo 
    "    font-family: Arial, sans-serif;\n"
    echo 
    "}\n"
    echo 
    "-->\n"
    echo 
    "</style></head>\n"
    echo 
    "<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n"
    echo 
    "<!--url's used in the movie-->\n"
    echo 
    "<!--text used in the movie-->\n"
    echo 
    "<!-- saved from url=(0013)about:internet -->\n"
    echo 
    "<div align=\"center\">\n"
    echo 
    "  <p class=\"style1\">&nbsp;</p>\n"
    echo 
    "  <p class=\"style1\">Your submission has been received, thank you.</p>\n"
    echo 
    "  <p class=\"style1\">Please click the back button on your browser to return</p>\n"
    echo 
    "</div>\n"
    echo 
    "</body>\n"
    echo 
    "</html>\n"
    echo 
    "\n"
    Is ther anyway to change that so that it just goes to a page I already have on the server? Lets say something like apply-done.html

  • #11
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Ragel View Post
    Oh one quick question actually...

    At the very end of the file where it says

    Is ther anyway to change that so that it just goes to a page I already have on the server? Lets say something like apply-done.html
    this page don't have a '<?php' at the begining and a '?>' at the end?
    in this case add them, this is probably the cause of the error.

    best regards

  • #12
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Ragel View Post
    Oh one quick question actually...

    At the very end of the file where it says

    Is ther anyway to change that so that it just goes to a page I already have on the server? Lets say something like apply-done.html
    I don't understand, you want to make this html? in this case:
    - remove echo ", from the begining of each line
    - remove \n"; from the end of each line
    Edit:
    sorry, I miss, must also replace \" with ", I do this in this replay too.

    or cut and paste this, :
    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 
    <title>Thank you - 8777GetMoney</title> 
     
    <script type="text/javascript"> 
    function resizeWindow(){ 
    //     window.resizeTo(300,300); 
    	window.menubar.visible=false; 
    	window.toolbar.visible=false; 
    	window.locationbar.visible=false; 
    	window.personalbar.visible=false; 
    	window.scrollbars.visible=false; 
    	window.statusbar.visible=false; 
    } 
    resizeWindow(); 
     
    </script> 
     
    <style type="text/css"> 
    <!-- 
    body { 
    	background-color: #FFFFFF; 
    } 
    .style1 { 
    	color: #000000; 
    	font-family: Arial, sans-serif; 
    } 
    --> 
    </style></head> 
    <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> 
    <!--url's used in the movie--> 
    <!--text used in the movie--> 
    <!-- saved from url=(0013)about:internet --> 
    <div align="center"> 
      <p class="style1">&nbsp;</p> 
      <p class="style1">Your submission has been received, thank you.</p> 
      <p class="style1">Please click the back button on your browser to return</p> 
    
    </div> 
    </body> 
    </html>


    best regards
    Last edited by oesxyl; 03-10-2008 at 01:47 AM.

  • #13
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh no that's not what I was refering to.

    This code actually sits on the bottom of my code.
    What I would like to do is instead of using the code that just says

    "Please click the back button on your browser to return"

    I would like to have the code redirect the user to another page on my website when they have finished the application form.

  • #14
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Ragel View Post
    Oh no that's not what I was refering to.

    This code actually sits on the bottom of my code.
    What I would like to do is instead of using the code that just says

    "Please click the back button on your browser to return"

    I would like to have the code redirect the user to another page on my website when they have finished the application form.
    if you are agreed to lose also the part with

    "Your submission has been received, thank you."

    you can replace all the echo part from previous replay with this line:
    PHP Code:
    header("Location: http://yourdomain/yourpage"); 
    best regards

  • #15
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Nevermind! I got that working in the end.

    I just did what you said and closed off the php and put my html right underneath.

    I think the fact that my friend who sent me the code had all those "echo"'s in there i thought I had to keep them in.

    Anyway, thanks again guys!
    This headache is finally over!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •