Post by karlpers » 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!

Active Member

Posts

Joined
Tue Jun 09, 2009 10:35 pm

Post by platoon » Sun Feb 23, 2014 11:49 pm

Yes, it is possible to execute (evaluate) string in PHP using command eval($string)
For more informations see: http://www.php.net/eval

Newbie

Posts

Joined
Sun Feb 23, 2014 11:44 pm

Post by karlpers » Mon Feb 24, 2014 2:26 am

Thanks a lot! I will have a look into that :)

Active Member

Posts

Joined
Tue Jun 09, 2009 10:35 pm
Who is online

Users browsing this forum: No registered users and 7 guests