Re: Echoing a variable within a variable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you use preg_replace with the e modifier, you can run eval on the
variables only:
http://us.php.net/preg_replace

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Phpster wrote:
> A couple of options:
>
> 1. Use eval($databaseString); there are risks as it could be used to
> execute arbitrary code should the database be compromised.
>
> 2. If your data string is enclosed in single quote php won't evaluate
> the variables. Consider changing the outside quotes to double quotes.
>
> Bastien
>
> Sent from my iPod
>
> On Jan 6, 2009, at 2:30 PM, "Stephen Sunderlin"
> <stephen.sunderlin@xxxxxxxxxxx> wrote:
>
>> I'm emailing an html file through phpmailer and the sql look up is
>> getting
>> the html from a table and setting it into a variable.  Within the
>> html from
>> the table are also variables that are also being called by the same
>> sql that
>> is looking up the html variable.  However the variable in the html are
>> echoing as $var instead of the assigned value being called from the sql
>> look-up
>>
>> Not sure what the solution is.  Any thoughts.
>>
>>
>>
>> -- 
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux