php for dynamic title and error reporting added