Is it possible to close a window using PHP after a form is submitted?

Yes, it is possible to close a window using PHP after a form is submitted by using JavaScript. You can include a JavaScript function in the PHP code that will close the window once the form is submitted successfully.

<?php
// Process form submission

// Check if form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Form processing code here

    // Echo JavaScript code to close the window
    echo '<script>window.close();</script>';
}
?>