Re: php parsing and db content [RESOLVED]

From: Date: Thu, 11 May 2006 12:01:42 +0000
Subject: Re: php parsing and db content [RESOLVED]
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-235974@lists.php.net to get a copy of this message
Chris wrote:
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. Thank you for all of your help Chris. Much appreciated.
-- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Business.Solution.Developers emotionalize.conceptualize.visualize.realize Landlines Tel: +27125468436 US Tel: (440) 499-5484 Fax: +27125468436 Web email:schalk@volume4.com Global: www.volume4.com Messenger Yahoo!: v_olume4 AOL: v0lume4 MSN: volume4_@hotmail.com We support OpenSource Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/ The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please contact the sender and please delete all traces of this material from all devices.

« previous php.general (#235974) next »