Fixes SQL Injection and XSS Vulnerabilities.

Using object oriented style.