basically you could give a user a texarea, than onsubmit load and execute the client-written code in a preview frame.
the problem is here about security. the client could use it as a mailspammer, view/download all the directories/files and lot of other more dangerous things.
my question is if there is a class already written which prevents the use of certain dangerous functions and constants??
or
what smart ways you would suggest preventing abuse of such a tool?
PS: here is a sample already doing this http://codepad.org/
http://php.net/manual/en/runkit.sandbox.php
You can pass in disable_functions, a “Comma separated list of functions to disable within the sandbox sub-interpreter.”