Some SQL injection problemans and possible XSS attacks

Just a quick edit. I didnt check everything.

Good luck!