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.
Results 1 to 5 of 5
  1. #1
    mypointofview
    Guest

    Quick question about some Parse error (unexpecte T_ENCAPSED...)

    Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /export/home/mylogin/public_html/myfile.php on line 6

    BTW -- what does the "T_" stand for?

    Here's the code (thanks to CYPHIX). I started right at the top of the document, but this error appears (with different line numbers) no matter where in my html I place it. Before my form or after -- always. When I used the other php code in the other thread here, not using $_POST, it was all fine!

    PHP Code:
    <?php 
    $sendto
    ="myname@mydomain.com";
    $emailsubject="Reply from Website";
    $thankyou="http://www.mydomain.com/thanks.html";
    $msg 'Tel: ' $visitorPhone "\r\n" stripslashes($comments);
    $from "From: $_POST['visitorName'] <$_POST['visitorEmail']>\n";

    if (
    $_POST['submit_x']) {
    mail($sendto$emailsubject$msg$from);
                    
    header("Location: $thankyou");
            }

    ?>
    BTW all registers are set to ON in the php.ini Also I should mention that I upload in ASCII mode (not knowing what that does or if it's even necessary but it seems more PRO?)

    Martin.
    Last edited by mypointofview; 09-07-2005 at 11:54 PM.

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try changing this line:

    $from = "From: $_POST['visitorName'] <$_POST['visitorEmail']>\n";

    to:

    PHP Code:
    $from "From: ".$_POST['visitorName']." <".$_POST['visitorEmail'].">\n"

  • #3
    mypointofview
    Guest

    Awesome :)

    That did it for that one -- THANKS!!

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    Quote Originally Posted by mypointofview
    BTW -- what does the "T_" stand for?
    Token

    One of the first stages of the PHP parsing process involves `tokenizing`your source into specific elements that PHP/Zend knows how to deal with.

    See the tokenizer functions for more info.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    New Coder
    Join Date
    Jul 2005
    Location
    Perth, Australia. Age: 13
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just saying, if you get a parse error, they aren't usually on the line it says its on. Always try looking at the coding around it for unclosed quotes, a missing ; or anything else like that.
    I lost my signature, have you seen it?
    I have the power to erase you...


  •  

    Posting Permissions

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