Running PHP commands saved in Mysql

Asked

Viewed 76 times

-2

I would like to know how to save and execute PHP code saved in my Mysql database. I have already created a basic structure for registering instructions. My question is about how to manipulate the use of these codes. For example, I have created a 'Statement' table containing the fields (ID, title, instructions). What is the most appropriate way to call these instructions?

  • PHP is not compiled. It is a scripting language.

1 answer

0

From what I understand you want to execute commands saved in the bank, for this just use the function eval() who receives a string as parameter and executes it as code PHP

$foo = "bar";
eval("echo $foo");
  • You should only be careful what you perform on eval

  • I understand, I’m going to give a study in this function. Taking advantage of the question, is it possible for me to block the use of certain words so that they are not interpreted? example: 'include'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.