runtime - How to execute PHP commands dynamically at run time? -
i wonder there way let's dynamically load piece of code @ run time? instance have simple "switch...case" statement this:
switch($choice) { case 'help': load_from_db('help'); break; case 'about': load_from_db('about'); break; }
and have database:
| keyword | command | require('help.php'); echo 'under construction.';
"load_from_db" function capable of reading db (we know how this) , execute corresponding command stored in database (my question part).
another example simple "textarea" form user can write php code within , submit form. @ server side code executed , result wil shown user (i know not safe, example).
any ideas?
you can use, should avoid, http://de.php.net/eval
Comments
Post a Comment