restored and updated index.php

Brought back the version of index that was overwritten, also added code to point log in submission to loading.php