ok so what i want to beable to do is have a coded up website template (with php in it) that is stored in the DB. and i would like to call it in a query. That part works fine but what doesnt work is the php being called from the DB. It seems like it just calls the php but it does not execute. I did look this problem up on the oracle (google) but saw told to stay away from eval(); or what ever it is.

Now you might be asking why i want to do this. well that is simple i would like to beable to change the template of site to something else by just uploading the code to the DB. Unless there is better way.

thanks in advance

Recommended Answers

All 5 Replies

ok so what i want to beable to do is have a coded up website template (with php in it) that is stored in the DB. and i would like to call it in a query. That part works fine but what doesnt work is the php being called from the DB. It seems like it just calls the php but it does not execute. I did look this problem up on the oracle (google) but saw told to stay away from eval(); or what ever it is.

Now you might be asking why i want to do this. well that is simple i would like to beable to change the template of site to something else by just uploading the code to the DB. Unless there is better way.

thanks in advance

If the HTML is stored in DB, you don't have any other option except taking that html and modifying the way you want and inserting back.
You can easily copy the that data while editing, if you have phpMyAdmin.
Don't forget to get the backup of it

understand but what about running php from the DB. in my template i also have php to call the navigation and info from the DB on top of html.

understand but what about running php from the DB. in my template i also have php to call the navigation and info from the DB on top of html.

you need to do the same for it

You could write the code to a file (saving it with a .htm or .php suffix) in a temp directory and then re-direct to that page. You'll want to limit the access to that directory so hackers can't create their own pages there.

ya i was thinking that is what i would have to do. even though it would be awesome if you can run some php from the DB but with some good security features

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.