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?

Edited by spacepoet
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.