add some php files and correct some bugs