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)
/**
* config.php
*
* Computer Science 50
* Problem Set 7
*
* Configures pages.
*/
// display errors, warnings, and notices
ini_set("display_errors", true);
error_reporting(E_ALL);
// requirements
require("constants.php");
require("functions.php");
// enable sessions
session_start();
// 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"]))
{
if (empty($_SESSION["id"]))
{
redirect("login.php");
}
}