Execute PHP from database in template file?
Posted: Sun Feb 23, 2014 10:58 pm
Im quite new to coding, and I struggle a little with a task, so I hope someone know a simple solution on this..
In my database, I store a php script, e.g. "<?php echo $some_information; ?>"
This string is stored under $this->config->get('database_entry')
Is it then possible to run this php in the template file, instead of just printing out the content as plain text.
If I paste the php script directly in the template file, it does what it should, but if I go via the database there is only plain text as output.
So, if there would be a commando to import and run the content from the database instantly, it would be great!
Dont ask me why I would go this way instead of just add the code directly in the template file...
Really thankful if someone knows a solution!
In my database, I store a php script, e.g. "<?php echo $some_information; ?>"
This string is stored under $this->config->get('database_entry')
Is it then possible to run this php in the template file, instead of just printing out the content as plain text.
If I paste the php script directly in the template file, it does what it should, but if I go via the database there is only plain text as output.
So, if there would be a commando to import and run the content from the database instantly, it would be great!
Dont ask me why I would go this way instead of just add the code directly in the template file...
Really thankful if someone knows a solution!