We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32013
    • 24 Posts
    wayne.yellow Reply #1, 16 years ago
    Hi,

    Could anyone tell me if I can include PHP code in a document?

    I am using:
    - MODx 2.0.4pl2
    - TinyMCE 4.1.1 editor

    I tried to include PHP code by typing the code in "HTML Source Editor" but the code is missing after I click the "Update" button and view back from the "HTML Source Editor" view.

    This is why I typed in the "HTML Source Editor":
    <?php
    echo "Hello";
    ?>
    


    Thank you,
    Wayne.

      • 22303 MODX Staff
      • 10,725 Posts
      Nope, that’s what Snippets are for. All PHP code must be contained in a Snippet (or Plugin) in MODx.
        • 32013
        • 24 Posts
        wayne.yellow Reply #3, 16 years ago
        Thank you so much for replying smiley