Re: php parsing and db content

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

 



Schalk wrote:
Chris wrote:

Chris wrote:

....

actually if it's only one variable, this might do it for you:

$content = str_replace('<?php echo _root ?>', _root, $content);

but that's still a bad way to do this.

Chris,

This works:

$breadcrumb = $row_pathway['pathway'];
$breadcrumb = str_replace('<?php echo _root ?>', _root, $breadcrumb);

echo $breadcrumb;

However, I would still like to know why this is a bad way to do this and hopefully find a better way. Still learning all the aspects of PHP so any input is appreciated.


Because you're including your config details in your data (I don't think you should do this, but others may disagree).

The str_replace method should be pretty fast and won't introduce any security issues like the 'eval' method I originally mentioned would.

--
Postgresql & php tutorials
http://www.designmagick.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux