Re: variables within variables
| From: | Jason Stechschulte | Date: | Tue, 01 May 2001 12:37:35 +0000 |
| Subject: | Re: variables within variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50980@lists.php.net to get a copy of this message | ||
On Sat, Apr 28, 2001 at 07:12:15PM +0100, Robert Morrissey wrote:
> I have a form on one page with a text box called 'emailtext'. This gets
> passed to a php script that gets info from a database (such as $name,
> $email, etc) and mails selected email addresses; my problem is this:
>
> Say, the form passes $emailtext as "Hello $name, how're you?", and this is
> passed to mail() in the php form, rather than emailing "Hello Bob, how're
> you?" it prints "$name" literally.
>
> Seeing as $name isn't pulled from the database till the php script is it
> possible to get it to print the value? or do I have to pull $name from the
> database in the original form? (which'll is going to be a lot more
> complicated).
>
> Does this make sense?
No, not really. What is the value of $name when the form passes $emailtext?
That is the value that will be in $name. If it is actually printing
$name and not an empty string, then the '$' must be getting escaped
somewhere along the line, or you are using ' instead of " around the
variable.
http://www.php.net/manual/en/function.echo.php
--
Jason Stechschulte
jpstech@unoh.edu
--
I'll say it again for the logic impaired.
-- Larry Wall