passing variable with texteditor tinymce

Talk about any other operations you need to implement: additions, updates etc.

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

passing variable with texteditor tinymce

Postby paragate » May 3rd, '17, 10:45


seems that input field textarea and tinymce editor escapes php-coding while javascripts is allowed like

Code: Select all

<h4 class="card-title">test 4</h4>
                        <p id="demo"></p>

var x = 5;
var y = 6;
var z = x + y ;
document.getElementById("demo").innerHTML = z;
<p> some more html </p>

Do Anyone knows how to do the same with php variables?
Or passing file.tpl

Posts: 243
Joined: Jan 1st, '16, 14:11

Re: passing variable with texteditor tinymce

Postby ne_moj » May 4th, '17, 13:41

Hello Henrik
I already answered you, but I want that the person who faces this problem know what he needs to do.
The problem is that the php code is executed on the server side, and what you are describing is not a php file, it is a string that is in the database, and in order for it to be executed you need to pass it through the eval function (see and it's very dangerous, I think it's not worth doing. Perhaps there is another way to solve this problem?

Return to “Additional operations implementation”