What are the potential pitfalls of using JavaScript for page redirection in PHP applications?

Using JavaScript for page redirection in PHP applications can lead to accessibility issues for users who have JavaScript disabled. To ensure that all users can be redirected properly, it's better to handle redirection on the server-side using PHP's header() function.

<?php
// Redirect to a new page using PHP's header function
header("Location: newpage.php");
exit();
?>