Update index.php

Added some code. if statement and for loop.