How to present php code on a page?

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.
Post Reply
schemberg
Forum Members
Forum Members
Posts: 17
Joined: Fri Oct 13, 2006 5:57 pm
Location: Kempen

How to present php code on a page?

Post by schemberg »

Hi,

I try to present php sourcecode on my page:

Code: Select all

<?php
phpinfo();
?>
... OK, different content.
I tried literal and tt, both don't works.

Anyone, who can help me?

Regards

Axel

p.s. I asked the same question in the german forum, but there was no solution.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: How to present php code on a page?

Post by RonnyK »

Axel,

you can use :
{literal}Put the code here{/literal}
Ronny
schemberg
Forum Members
Forum Members
Posts: 17
Joined: Fri Oct 13, 2006 5:57 pm
Location: Kempen

Re: How to present php code on a page?

Post by schemberg »

Hi Ronny,

thank you for the quick response. I tried to do so, but FCKEditor or TinyMCE delete content, so that the result ist:

Code: Select all

<p><code>{literal}{/literal}</code></p>
and the rest is missing. :(

...

Axel
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: How to present php code on a page?

Post by RonnyK »

Put the code inside the html-screen (HTML in Tiny, SRC in FCK), using that button, WYSIWYG wont do tricks with the provided content.

Ronny
schemberg
Forum Members
Forum Members
Posts: 17
Joined: Fri Oct 13, 2006 5:57 pm
Location: Kempen

Re: How to present php code on a page?

Post by schemberg »

Hi Ronny,

yes that was what I did: HTML (not wysiwyg). But after switching between WYSIWYG and HTML the php-code is gone  :-\

Regards

Axel
Pierre M.

Re: How to present php code on a page?

Post by Pierre M. »

Hello,

if you want to put PHP code in pages, you don't want to use wysiwyg, do you ?
Disable the wysiwyg in your preferences. (prefered wysiwyg editor = none)

Pierre M.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: How to present php code on a page?

Post by Nullig »

It's better to just put your code in a UDT and call it on your page.

Create a UDT called infophp and put this in it:

Code: Select all

phpinfo();
Then, in your page call the UDT like this:

Code: Select all

{infophp}
Nullig
Post Reply

Return to “CMSMS Core”