How can the issue of "Invalid search type" be resolved when trying to go back to customer search?

Issue: The "Invalid search type" error occurs when the search type specified in the code does not match any valid search types. To resolve this issue, ensure that the search type is correctly defined and matches the available search types.

// Check if the search type is valid before performing the search
$searchType = $_GET['search_type'];

$validSearchTypes = ['name', 'email', 'phone'];

if (!in_array($searchType, $validSearchTypes)) {
    // Handle invalid search type error
    echo "Invalid search type";
    exit;
}

// Perform the customer search based on the valid search type
// Your search code here