Forum Moderators: coopster
if (something){
print str_replace($array_values, $array_variables, $section_code);
}
else {
do something else}
everything fetches and prints from the DBase just fine until I have something like 'echo $somestring;' in the retrieved code.
instead of printing 'whatever the string is' it prints 'echo whatever the string is'
do I need to replace the php commands somehow?
you could use
[php.net...]
Until this point, I was simply replacing variables because I didn't need to use code.
I have a situation now that is easily solved if I can store some PHP with variables inside the code, and let it execute at certain times.
I basically need one statement that execute the whole thing, variables, and code when needed. If I can execute the whole thing as code without having to worry about replacing the variables, thats fine too.
I've been using eval($somestring);
How different is that from the method that you suggested where I echo $somestring into $content, and eval ($content)?
so i threw some php code into a var and eval'ed the var, that's all I wanted to show you.
You just eval whatever the var is where you have the code selected from the column in your db.
I think that the problem here is that I'm building a script that is so complex that when I look at it from too wide an angle, I have no idea wth I'm doing. LOL
10 dollar brain building 100 dollar site. ;)