PHP Errors fixes, added example file

- PHP Errors fixes
- added example file
- code is now ready to be used