Look in your config.php file (it is in "includes" directory).
'Loop redirect' means that your site redirect the user to another (maybe the same, but still a redirect) page, and the new page redirect again... and the new page redirect again... and the new. You understand.
In the config file you find a script that redirects the user to the login page. Check if there is a condition that prevents redirect when the user is already on the login (or in the register) page.
This is how the config.php looks like: (maybe you corrupted it)
* Computer Science 50
* Problem Set 7
* Configures pages.
// display errors, warnings, and notices
// enable sessions
// require authentication for all pages except /login.php, /logout.php, and /register.php
if (!in_array($_SERVER["PHP_SELF"], ["/login.php", "/logout.php", "/register.php"]))