I have a mysql database and in one of the fields I have a bunch of normal html and a php script in the middle of it. When I pull from the database and display the field the php does not render as php, but as html. Was wondering if it is possible to put php scripts in a mysql database field and then have them render as php when pulled onto a web page, and if so how do i do this.
Share
I have done this before using the eval function. However, eval is dangerous because if malicious code gets injected it could cause serious harm, so proceed with caution.
What I have done as an alternative is store a class name and parameters in a database and then generate the given class to generate the html and php.