Convert index to php and add session variable

Convert index to php and add session variable