"Richard Kurth" <[EMAIL PROTECTED]> wrote:
> How can I add a variable to an e-mail on the fly. Say I have a form on
> my page that the user fells in with data. but when he fills in the
> message things like Hello,$Variable are added before it is sent. Does
> this make sence

If you're using the mail() function set the message string to $msg_body.
Then build $msg_body from the form data.  If you're posting the form the
variables will be accessible within $HTTP_POST_VARS[], if you're within a
function you'll have to declare that array global first or access like
$GLOBALS["HTTP_POST_VARS"]["my_form_field"].  So, in your example you'd do:

$msg_body = "Hello, " . $GLOBALS["HTTP_POST_VARS"]["variable"];

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/

Reply via email to