How can a PHP script be used to display a disclaimer page before redirecting to a link?

To display a disclaimer page before redirecting to a link using a PHP script, you can create a PHP file that first displays the disclaimer content and then redirects the user to the desired link after they agree to the terms. This can be achieved by using a form with a submit button that, when clicked, redirects the user to the link.

<?php
if(isset($_POST['agree'])) {
    header("Location: http://www.example.com");
    exit();
}
?>

<!DOCTYPE html>
<html>
<head>
    <title>Disclaimer Page</title>
</head>
<body>
    <h1>Disclaimer</h1>
    <p>This is the disclaimer content. Please read and agree to proceed.</p>
    
    <form method="post">
        <input type="submit" name="agree" value="I Agree">
    </form>
</body>
</html>