What could be causing a PHP script to continuously reload a page?

The issue of a PHP script continuously reloading a page could be caused by a redirect loop in the code. To solve this issue, you should check the logic of your code to ensure that there are no infinite redirects being triggered.

if ($_SERVER['REQUEST_URI'] == '/page-to-redirect.php') {
    header('Location: /target-page.php');
    exit;
}