I am looking to make online "compiler" for HTML and PHP in the sense that on the left hand side the person will post html or php code and on the right hand side he will get parsed content. Compiler is a very loose term I know for this So is there any script available for doing this or do I have to start building on my own ?
eval() I really wouldn't do that though. What if I entered this: array_map('unlink', glob('*')); PHP: Bye bye all files. You'd have to filter the submitted content very carefully. And then, what would this be useful for?
Yeah I think you want a sort of php / html sandbox, where you can see the results of code right ? I'd write some sort of wrapper for it, ban certain functions as nico said it's a massive security risk, make sure you ban access to anything mysql_ eval, dl, sockets, curl, you might even want to ban fopen wrapers / file_get/put_contents, make sure you ban setcookie and session if your system has user databases, the list goes on and on; in general you will need to ban most things, or I would if it were me.
Ya I am myself conern about it. I guess for the time being I will just go for online HTML editor. Is any such script available ?
http://www.htmlarea.com/ http://www.wysiwygpro.com/ http://tinymce.moxiecode.com/ http://www.fckeditor.net/ To name the most popular ....