yoshida Posted September 5, 2006 Share Posted September 5, 2006 Hi. Can PHP code be loaded and executed from a database, which in turn loads and echoes html info from the same database? I want to be able to add and alter modules from my script using a content manager (which I already created to successfully add, alter and load html pages with). Link to comment Share on other sites More sharing options...
tutsamewasa Posted September 5, 2006 Share Posted September 5, 2006 Hi,The PHP page can be loaded from the DB but can not run from DB as far as I know. The PHP code has to be parsed through the PHP engine. So you can have PHP page that gets the Code from DB at run time and execute as normal page.Hope this helps.Good LuckHemendra Singh ShaktawatMindfire Solutionswww.mindfiresolutions.com Link to comment Share on other sites More sharing options...
yoshida Posted September 5, 2006 Author Share Posted September 5, 2006 I played around with it a little, and tried to have it displayed as I would normally do with html data. The script queries the database and echoes the (php) output. So far so good.However, the echoed script itself needs to make a query too for html info. But instead of the desired html data all I see is variables. Too bad.It still leaves me with a pretty neat content manager for html pages. Anyone who desires a template of the so-called 'eggshell sitebuilder' can send me a pm. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2006 Share Posted September 5, 2006 It's probably not very secure if you have a page that displays your source code. You can get the code in a string, and use the eval function to execute it:http://www.php.net/manual/en/function.eval.php Link to comment Share on other sites More sharing options...
yoshida Posted September 6, 2006 Author Share Posted September 6, 2006 Thanks, I'll play around with that. How cool is that: a content manager with a script editor. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now