Hi ,
My site has a backend , the backend stores data through a WYSISYG editor . This editor is using htmlentities function to store any changes in the database through backend .
To display the data stored my site uses htmlentitydecode() function by fetching an object from database .
I want to include a php function in the site , however when i enter php function through backend , it simply echoes all php code . e.g. <?php echo "hello"; ?>
page displaying code is php itself.
Any way to get around this problem ?
Thanks
calling a function within html entity decode
Moderator: General Moderators
-
mattpointblank
- Forum Contributor
- Posts: 304
- Joined: Tue Dec 23, 2008 6:29 am
Re: calling a function within html entity decode
Do you not have access to the backend code so you can change the function or something? You could modify the function like so:
Then normal calls can just stay like processForBackend("hello"), and PHP can be called like processForBackend("<?php echo "hello"; ?>, false); (untested, but should be okay).
Code: Select all
function processForBackend($input, $on=true) {
if($on) {
// do stuff to clean up code
} else {
return $input;
}
}