Jump to content

Ckeditor And Php Tags In Rte (Rich Text Editor)


spacepoet

Recommended Posts

Hello:

 

Does anyone use CKEditor?

 

I want to insert PHP tags:

<? echo $myVar; ?>

 

via the RTE (Rich Text Editor) but I cannot get them to display on the website.

 

I am inserting the data in an admin area so I am not worried about malicious code.

 

When I display the data on the frontend it does not appear.

But, when I view the source code it is showing the code as I entered it:

<? echo $myVar; ?>

 

rather than whatever the myVar is (Hello World, for example).

 

Does anyone know why this is happening or have a solution?

 

I thought maybe I could do a str_replace as I insert the data or display the data .. ??

 

INSERT

$myVar = mysql_real_escape_string(str_replace(array('{%', '%}'), array('<?', '?>'), $_POST['myVar']));

 

Using a set of {% %} tags first, but this does not work the way I am doing it.

 

Display:

$myVar = $row['myVar'];

 

Or, is there an encoding type I need to declare ..??

 

Anyone have any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.