updated index to php file. also enhanced with php functions