Creation of the index.php and associated logic