Re: variables in a e-mail

From: Date: Mon, 18 Jun 2001 23:40:01 +0000
Subject: Re: variables in a e-mail
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-54292@lists.php.net to get a copy of this message
"Richard Kurth" <rkurth@pacifier.com> 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/

« previous php.general (#54292) next »