I have a PHP/MySQL website on 000webhost (http://www.boisvert.me.uk; but it's down for review at the moment) and I'm concerned about its security. What I'm trying to do will make any site vulnerable; it's the PHP equivalent of giving sharp cissors to children. I have various ideas for minimising the site's vulnerability, but more advice would be welcome.
In particular, there are two scripts:
An upload script. Its purpose is to allow a registered site user to upload certain XML files (tutorials). Obviously, to do that, a folder on the site gives write access to visitors. I don't like that, but I don't see a way around, I can add checks to the script (type, size) to ensure that files uploaded are limited to XML and some images. Are there other points I could improve this with?
Script 2 is an interpreter for PHP - a user can enter PHP in a form and it will execute (without saving). I want users to be allowed to try database access, so a crude string replacement ensures that I don't need to give away MySQL access information. But an attacker could use this interpreter to obtain access to the files area and upload unwelcome material. My solution would be to place the interpreter in a separate domain, where no files can be uploaded.
Any advice to improve on this is welcome, bar "don't do it". I know it's dangerous. So is crossing the street. Thanks for your help.