How can the header() function in PHP be utilized to redirect users to a different page after successfully verifying a Captcha input?

To redirect users to a different page after successfully verifying a Captcha input in PHP, you can utilize the header() function to send a raw HTTP header to the browser, which will redirect the user to the desired page. You can use an if statement to check if the Captcha input is correct, and if it is, use the header() function to redirect the user to the new page.

<?php
// Check if Captcha input is correct
if ($captcha_verified) {
    // Redirect user to a different page
    header("Location: new_page.php");
    exit();
} else {
    // Handle incorrect Captcha input
    echo "Captcha input is incorrect.";
}
?>