Page 1 of 1

FCKeditor and php

Posted: Wed Dec 31, 2008 2:26 pm
by madar
Hello.
Please how I import php code, for example
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
to my contect? I use FCKeditor, but php don't work :(
Thanks

Re: FCKeditor and php

Posted: Sat Jan 03, 2009 12:34 pm
by Holger
madar wrote:Hello.
Please how I import php code, for example
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
to my contect? I use FCKeditor, but php don't work :(
Thanks
You can use pure PHP only in the template.

To run PHP in the content, you have to use CMSimple Scripting http://www.cmsimple.com/?Installer%27s_ ... _Scripting.

The code below should work in the content:

Code: Select all

#CMSimple $output.= $_SERVER['REMOTE_ADDR'];#
but the output of the page will stop after this script.

A better solution for your example should be:

Code: Select all

<p>Your IP is:  #CMSimple $output=preg_replace("/".chr(35)."CMSimple.*".chr(35)."/",$_SERVER['REMOTE_ADDR'],$c[$s]);# <br />
Content goes on here...</p>
Note that some online-editors have problems with the integration of scripts. I wrote down a solution for FCKeditor here at the board:
http://cmsimpleforum.com/viewtopic.php?f=7&t=302


Holger

Re: FCKeditor and php

Posted: Sat Jan 03, 2009 4:59 pm
by Connie
Holger,

you were faster than I was... I had that in mind, too...
it is not possible to enter plain code in the content without CMSimple Scripting

have a nice evening,

Connie