Splitting index in PHP files

Now the logic can be implemented.