Are there best practices for handling user navigation between different product types in a PHP application?

When handling user navigation between different product types in a PHP application, it's important to maintain a clear and consistent user experience. One way to achieve this is by using a switch statement to determine the product type and redirecting the user to the appropriate page based on their selection.

// Get the product type from the user input
$productType = $_GET['product_type'];

// Use a switch statement to determine the product type and redirect the user
switch ($productType) {
    case 'electronics':
        header('Location: electronics.php');
        break;
    case 'clothing':
        header('Location: clothing.php');
        break;
    case 'books':
        header('Location: books.php');
        break;
    default:
        header('Location: error.php');
        break;
}