Page 1 of 1

Insert php code inside a textarea

Posted: 2017-07-15 23:05
by olivier
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

Re: Insert php code inside a textarea

Posted: 2017-07-25 15:03
by a.gneady
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.