Insert php code inside a textarea

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
olivier
Posts: 5
Joined: 2016-10-21 19:47

Insert php code inside a textarea

Post by olivier » 2017-07-15 23:05

Hello,

I've been trying to write php line inside text areas (or rich areas) and when I save the data everytime all characters are replaced with other characters and then the php code can't be run.
This is an example : <?php echo "test"; ?> becomes <!--?php echo "test"; ?-->
Not very good at programming I had a glance at ci_input.php and I think that it deals with this.
How can we allow php coding in text areas ?
Thank you very much,
Olivier

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: Insert php code inside a textarea

Post by a.gneady » 2017-07-25 15:03

PHP tags as well as many forms of HTML are filtered out from user input to prevent security issues. If you wish to store code samples into the database, try using an HTML area rather than a plain text area. Alternatively, you could enter &lt;?php instead of <?php in your text area.
:idea: AppGini plugins to add more power to your apps:

Post Reply