Are there any best practices for handling page reloading after using the history.back() function in PHP?

When using the history.back() function in PHP to navigate back to the previous page, the browser may prompt the user to confirm the page reload. To prevent this prompt, you can use the header() function in PHP to redirect the user back to the previous page without triggering the reload confirmation.

<?php
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
?>