Jump to content

[SOLVED] $string as code


stylusrose

Recommended Posts

from php.net:

Evaluates the string given in code_str  as PHP code. Among other things, this can be useful for storing code in a database text field for later execution.

 

There are some factors to keep in mind when using eval(). Remember that the string passed must be valid PHP code, including things like terminating statements with a semicolon so the parser doesn't die on the line after the eval(), and properly escaping things in code_str . To mix HTML output and PHP code you can use a closing PHP tag to leave PHP mode.

 

Also remember that variables given values under eval() will retain these values in the main script afterwards.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.