I'm filling out forms on one page, then trying to send an
email and print out the vars on the next page.
Q1: Whenever I insert the mail script, it gives me a parse error.
Please point out my syntax errors, etc.
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /mypathhere/proposalconfirm .php on line 2
--script in question
<? session_start() ;
$msg = "x x proposal for:\n\t$_POST['cpname'],\t$_POST['cptitle']\n";
$msg .= "\t$_POST['cpcomp']\n";
$msg .= "\tAddress:\t$_ POST['cpaddress']\n";
$msg .= "\t$_POST['cpcity'], $_POST['cpstate']\t$_POST['cpzip']\n";
$mailheaders = "From: company name here\n";
$mailheaders = "CC: $_POST['cpemail']";
mail("me@my.com ","x x Custom Proposal",$msg, $mailheaders);
?>
<html>
--rest of script--
The printing of all vars works fine (once I removed the double
quotes from the post var callouts)
Q2: Do I need sessions to track the form vars from page to page
or am I adding unnecessary complexity to this?
My last large PHP dev work was about 2 years ago. Since then,
quick and dirty flatfile database connections (member lists)
are all I've had to contend with. Things have really changed
with PHP and MySQL in that time.
Thanks in advance for the help.
email and print out the vars on the next page.
Q1: Whenever I insert the mail script, it gives me a parse error.
Please point out my syntax errors, etc.
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /mypathhere/proposalconfirm .php on line 2
--script in question
<? session_start() ;
$msg = "x x proposal for:\n\t$_POST['cpname'],\t$_POST['cptitle']\n";
$msg .= "\t$_POST['cpcomp']\n";
$msg .= "\tAddress:\t$_ POST['cpaddress']\n";
$msg .= "\t$_POST['cpcity'], $_POST['cpstate']\t$_POST['cpzip']\n";
$mailheaders = "From: company name here\n";
$mailheaders = "CC: $_POST['cpemail']";
mail("me@my.com ","x x Custom Proposal",$msg, $mailheaders);
?>
<html>
--rest of script--
The printing of all vars works fine (once I removed the double
quotes from the post var callouts)
Q2: Do I need sessions to track the form vars from page to page
or am I adding unnecessary complexity to this?
My last large PHP dev work was about 2 years ago. Since then,
quick and dirty flatfile database connections (member lists)
are all I've had to contend with. Things have really changed
with PHP and MySQL in that time.
Thanks in advance for the help.
Comment