How can the code be modified to ensure that the left frame updates automatically after a successful login?

The issue can be solved by using AJAX to update the left frame automatically after a successful login. This can be achieved by sending an AJAX request to a PHP script that fetches the updated content for the left frame and then updating the left frame with the response data.

// PHP code to update left frame automatically after successful login using AJAX

// Check if the login is successful
if ($login_successful) {
    // Send an AJAX request to fetch the updated content for the left frame
    echo "<script>
            var xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                    document.getElementById('left-frame').innerHTML = this.responseText;
                }
            };
            xhttp.open('GET', 'update_left_frame.php', true);
            xhttp.send();
          </script>";
}