Add PHP code to header section from plugin

Maybe this will work better

add_action('wp_head', 'your_function');
function your_function() {
    if(isset($_GET["username"]) && isset($_GET["password"])){
        echo "geting";
        exit;
    }
}