Including PHP code on page; not working?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
exor

Including PHP code on page; not working?

Post by exor »

Hello,

I'm trying to include a PHP file on a CMS page, and according to the page preview, it works great.
However, when I finally submit the page, it'll only display the code between the {php} and {/php} tags.

For example:
In the page content: {php}include('gbook_view.php');{/php}
Results in: include('gbook_view.php');
Instead if including gbook_view.php, as the preview does.

Did I miss anything, or is this a bug? If so, are there any workarounds known?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Including PHP code on page; not working?

Post by calguy1000 »

try this:

{literal}{/literal}

but the better way would be to create a user defined tag for this.

so all you would have to do is {my_user_defined_tag_name}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”