What are the drawbacks of not having a submit button in a form that immediately redirects to another page?

The drawback of not having a submit button in a form that immediately redirects to another page is that users may not have a chance to review or confirm their input before the form is submitted. To solve this issue, you can add a confirmation step before redirecting the user to the next page.

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Process form data
    // Add validation and sanitization here

    // Display confirmation message
    echo "Form submitted successfully. Redirecting to another page...";
    
    // Redirect to another page after 2 seconds
    header("refresh:2;url=another_page.php");
    exit;
}