Refactor duplicate codes [issue#50].

Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>

[Issue#50](https://github.com/phpmyadmin/error-reporting-server/issues/50) Resolved!! :smile: