Jump to content

Recommended Posts

Hi guys, have just embarked on making my site all dynamic, and have had the same problem which i could foresee. I've got the navbar code all stored in the db fine, and it's bringing it in in a seperate function page and then called in the main page, this is working great.

 

I've also got a sidebar on the page which i wanted to do the same to, so went about it in the same method. However the sidebar also had PHP code in, and this code isnt being processed, just echoed on the page!

 

So to clarify,

 

On the page i've got a funciton call to a seperate php page with a function called "sidebar". This is called from the page then the result ECHOED. In the sidebar function there is php code which brings in from the Mysql DB, WHERE area=sidebar, and then RETURNS the result. HOWEVER (lol) in this code which is bought in from the mysql, there is also PHP code which draws from a different mysql db. So basically i want it to process the code, bring in more code, and then process it again, which i;m guessin is the problem!

 

Is there anyway round this?

 

Kind Regards, Chris

Link to comment
https://forums.phpfreaks.com/topic/148743-solved-inserting-php-code-from-a-db/
Share on other sites

lol!

 

I dont know! How else would i do it? I've got a sidebar with a bunch of different <div>'s from the CSS page and then a couple of PHP sections and want to be able to change it in one place and have it go through the whole site!

 

In the next coupla months i'm going to construct it so that the content is stored in the DB but for now, i need to instead store the sidebar and navbar in a seperate place, hence the DB!

 

Help!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.