How can a URL with a parameter like ?ref be used to access different pages for multiple partners in PHP?

When using a URL parameter like ?ref to access different pages for multiple partners in PHP, you can use conditional statements to determine which partner's page to display based on the value of the ref parameter. By checking the value of the ref parameter in the URL, you can redirect the user to the corresponding partner's page.

<?php
// Check if the ref parameter is set in the URL
if(isset($_GET['ref'])) {
    $partner = $_GET['ref'];

    // Redirect the user to the corresponding partner's page
    switch($partner) {
        case 'partner1':
            header("Location: partner1_page.php");
            break;
        case 'partner2':
            header("Location: partner2_page.php");
            break;
        case 'partner3':
            header("Location: partner3_page.php");
            break;
        default:
            // Redirect to a default page if the partner is not found
            header("Location: default_page.php");
            break;
    }
} else {
    // Redirect to a default page if the ref parameter is not set
    header("Location: default_page.php");
}
?>