RE: [PHP] Replacing template variables with values?

2001-08-02 Thread scott [gts]
try using single quotes : preg_replace("/\$(\w+)/e", '${$1}', $template); > -Original Message- > From: Ryan Fischer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 01, 2001 6:37 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Replacing template v

Re: [PHP] Replacing template variables with values?

2001-08-01 Thread Ryan Fischer
You wrote: > > This always works for me... > > > > eval ("\$message = \"$message\";"); > > RED ALERT! SECURITY TO THE BRIDGE! > > "Captain, there's Klingons off the starboard bow!" > > Oh, sorry. Did I type that aloud? Sorry. > > If $message is a free-form email typed in by a potentially malici

RE: [PHP] Replacing template variables with values?

2001-08-01 Thread Tyrone Mills
riginal Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 10:03 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Replacing template variables with values? > This always works for me... > > eval ("\$message = \"$message\";"); R

Re: [PHP] Replacing template variables with values?

2001-08-01 Thread Richard Lynch
> This always works for me... > > eval ("\$message = \"$message\";"); RED ALERT! SECURITY TO THE BRIDGE! "Captain, there's Klingons off the starboard bow!" Oh, sorry. Did I type that aloud? Sorry. If $message is a free-form email typed in by a potentially malicious user this looks pretty da

Re: [PHP] Replacing template variables with values?

2001-08-01 Thread Ryan Fischer
You wrote: > This always works for me... > > eval ("\$message = \"$message\";"); > > I use it in the same type of scenario you've described, and also with E-Mail > bodies stored in a DB. Works like a charm. Thanks, that worked great! :D -- -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigabo

RE: [PHP] Replacing template variables with values?

2001-08-01 Thread Tyrone Mills
] Sent: Wednesday, August 01, 2001 3:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Replacing template variables with values? Hello! :) I have a form with a textarea that contains a template e-mail with variables in it. I would like to be able to replace those variables with values. The variables

[PHP] Replacing template variables with values?

2001-08-01 Thread Ryan Fischer
Hello! :) I have a form with a textarea that contains a template e-mail with variables in it. I would like to be able to replace those variables with values. The variables named in the template are actual variables in my script. This doesn't seem to work: $newmail = preg_replace("/\$(\w+)/e"