3 Replies Latest reply on Jan 9, 2009 4:54 AM by (chrisbleak)

    dynamic content with php code embedded

      Hi, I am probably missing something, but here goes.
      I am trying to create a personal website using dreamweaver CS3/ADDT with completely dynamic content.

      I think I have most of it up and running except for a couple of things. I am creating my dynamic content using tinymce. I have that configured and running using the codeprotect plugin so my code doesn't get changed.

      What I need to know is how do I embed php code into a mysql text field and then have the embedded php rendered in my index.php page.

      When I embed a "hello world" echo into my tinymce content text area, and open the page, the hello world does not appear, but if I look at the source code, I see the following:


      I am assuming that the php doesn't render as it is embedded in the recordset field that is on my index.php page and php is done doing its thing by the time it gets to the php within the recordset field.???

      Can anyone suggest a solution? or if you need more clarification, I would be more than happy to answer.


        • 1. Re: dynamic content with php code embedded
          Günter Schenk Level 4

          this doesn´t work with ADDT, and it wouldn´t work with DW´s native behaviours as well -- what you want, is some sort of "PHP within PHP" solution, but all what does, is displaying the column contents with/without HTML markup and without having an "idea" how to parse additional PHP stuff.

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: dynamic content with php code embedded
            Level 1
            Thanks for the reply. I came up with a work around for what I am trying to do by adding a conditional region on the index.php. I still need to figure out the php within php solution, but it gives me a direction to move towards.
            • 3. Re: dynamic content with php code embedded
              Level 1
              Try this

              use eval() to evaluate your code stored in the variable.


              but Chances are tiny mce is encoding the php as html and i am not sure if addt will also be html encoding it it as well, so you need to check in the database if the text is encoded or escaped in some fasion. dont use tiny mce to insert the code just use a normal text area field and if addt is html encoding then you will have to use addt html de encode function to reverse what ever addt may have done to it.