KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Running dynamic PHP scripts
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: February 24, 2011

When running PHP scripts from 4D, in general, the PHP scripts will be static. Meaning that the PHP code will be stored in a file. However, there may be instances where you would want to execute dynamic PHP code. Meaning that the PHP code will be built at runtime.

This can be accomplished by writing the PHP code to a file and then running PHP Execute using that file. Here is how the basic workflow would be:

  • put PHP code in a text variable

  • write the PHP code to a file

  • run PHP Execute, specifying the path to the newly created file

  • (optional) delete the file