Re: php parsing and db content [RESOLVED]
| From: | John Hicks | Date: | Thu, 11 May 2006 14:55:08 +0000 |
| Subject: | Re: php parsing and db content [RESOLVED] | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235981@lists.php.net to get a copy of this message | ||
Schalk Neethling wrote:
Chris wrote:But how did you resolve it? (You should have been able to include a file containing <?php echo ... ?> directives and have them correctly interpreted.) --JohnSchalk wrote:Thank you for all of your help Chris. Much appreciated.Chris wrote: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.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.