Create validator.php

Adds server side validation.