How can the issue of data not being displayed on the subsequent PHP page after form submission be addressed?

Issue: The data may not be displayed on the subsequent PHP page after form submission due to improper handling of form data. To address this issue, ensure that the form data is properly submitted using the POST method and that the data is correctly retrieved and displayed on the subsequent PHP page.

<?php
// Check if form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Retrieve form data
    $name = $_POST["name"];
    $email = $_POST["email"];
    
    // Display form data on subsequent page
    echo "Name: " . $name . "<br>";
    echo "Email: " . $email;
}
?>