Page 1 of 1

calling a function within html entity decode

Posted: Wed Jan 21, 2009 8:04 am
by mananx
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

Re: calling a function within html entity decode

Posted: Wed Jan 21, 2009 8:40 am
by mattpointblank
Do you not have access to the backend code so you can change the function or something? You could modify the function like so:

Code: Select all

 
function processForBackend($input, $on=true) {
    if($on) {
        // do stuff to clean up code
    } else {
        return $input;
    }
 
}
 
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).