Page 1 of 1

please help with Parse error

Posted: Tue Jul 20, 2010 6:51 am
by jarv
I get the following message when I try and send an email:

error message: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\jbiddulph.com\wwwroot\iphone\send_email.php on line 10

Code: Select all

<?php

    //change this to your email.
    $to = "john.mbiddulph@gmail.com";
    $from = $HTTP_POST_VARS['email'];
    $subject = "email from iphone.jbiddulph.com";

    //begin of HTML message
    $message = <<<EOF
<html><body bgcolor="#DCEEFC"><b>$HTTP_POST_VARS['username'];</b><br><br><br>"."$HTTP_POST_VARS['message'];"."</body></html>
EOF;
   //end of message
    $headers  = "From: "$HTTP_POST_VARS['username'];
    $headers .= "Content-type: text/html\r\n";

    //options to send to cc+bcc
    //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]";
    //$headers .= "Bcc: [email]email@maaking.cXom[/email]";
    
    // now lets send the email.
    mail($to, $subject, $message, $headers);

    echo "Message has been sent....!";

?>

Re: please help with Parse error

Posted: Tue Jul 20, 2010 7:21 am
by Alex-V
User $_POST instead of $HTTP_POST_VARS

Re: please help with Parse error

Posted: Tue Jul 20, 2010 7:26 am
by jarv
changed it to just $post and it still errors?!

Re: please help with Parse error

Posted: Tue Jul 20, 2010 7:41 am
by Alex-V
Not to $post it should be $_POST and why not do this

Code: Select all

$message = '
<html><body bgcolor="#DCEEFC"><b>'.$_POST['username'].'</b><br><br><br>'.$_POST['message'].'</body></html>';