Wrote the controller in php.