FCKeditor and php

Questions about how to use the online - editors and suggestions how to improve them

FCKeditor and php

Postby madar » Wed Dec 31, 2008 2:26 pm

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
cmsimpleforum.com best CMSimple community!
madar
 
Posts: 12
Joined: Wed Dec 31, 2008 1:32 pm
Location: Hungary

Re: FCKeditor and php

Postby Holger » Sat Jan 03, 2009 12:34 pm

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_Manual:CMSimple_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
Holger
Site Admin
 
Posts: 2572
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: FCKeditor and php

Postby Connie » Sat Jan 03, 2009 4:59 pm

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
|---
Connie Müller-Gödecke, http://www.webdeerns.de
Connie
 
Posts: 290
Joined: Thu May 22, 2008 10:11 am
Location: Hamburg


Return to Editors

Who is online

Users browsing this forum: No registered users and 1 guest