Are there any best practices for implementing pop-up windows in PHP without relying on JavaScript?

When implementing pop-up windows in PHP without relying on JavaScript, one common approach is to use the header() function to redirect the user to a new page that contains the content for the pop-up window. This can be achieved by setting the Content-Type header to "text/html" and then echoing out the HTML code for the pop-up window.

<?php
// Check if the pop-up window should be displayed
if ($showPopup) {
    // Set the Content-Type header to "text/html"
    header('Content-Type: text/html');
    // Echo out the HTML code for the pop-up window
    echo '<html><body><h1>This is a pop-up window!</h1></body></html>';
    exit;
}
?>