php - Form values into an array for emails -
i have php script sends email specified email address:
$headers = array( 'from: emailhidden', 'content-type: text/html' ); $body = array( '<br><br><br>', '<h3>success!</h3><br>', '<p>your sign panda successful! may sign in using information provided below.</p>', '<p><b>login url:</b> <a href="http://www.green-panda.com/my-panda.html">http://www.green-panda.com/my-panda.html</a></p>', '<p><b>username:</b> echo "$_post[unique_id]";</p>', '<p><b>username:</b>". $post['unique_id']."</p>', '<p><b>password:</b> echo "$_post[passphrase]";</p>', '<p>if ever have problems panda or have questions, please contact at: moevans@green-panda.com' ); mail('emailhidden', 'my panda registration', implode("\r\n", $body), implode("\r\n", $headers));
the problem lays right here: <p><b>username:</b> echo "$_post[unique_id]";</p>',
, same pass phrase. display , not entered on form. how them display posted on form previous script? input field names same post values in script. thank you!
no offense intended, code riddled bugs , syntax errors.
first of all, you're using single quotes, php isn't interpreting value of variables.
secondly, you're calling echo inside string literal.
third, missing quotes on lot of post array indexes.
fourth, missing underscores of $_post variables.
fifth, displaying username twice in row, intended?
this should help:
'<p><b>username:</b>' .$_post['unique_id'].'</p>', '<p><b>username:</b>' .$_post['unique_id'].'</p>', //why twice? '<p><b>password:</b>' .$_post['passphrase'].';</p>',
you should know: if declare string single quotes, php not interpret of variables inside. try , you'll see mean:
$foo = "bar"; echo '$foo'; echo "$foo";
since using single quotes, added concatenation above make code work. have accomplished same thing using single quotes inside tags, , enclosing string in double quotes. run variables in line, this:
"<p><b>username:</b>$_post['unique_id']</p>",
Comments
Post a Comment