CakePHP查找查询字符串时的未定义索引

I get an error saying 'Undefined index: redirect'

with this code:

        $came_from_site = $_GET['redirect'];
        if($came_from_site != "true")
        {
            echo 'USER TYPED IN URL MANUALLY';
        }

The error happens when the query string doesn't exist.... So I guess I need to check if a) it exists and then if it does b) check that it's value is true

Can anyone help?

Thanks

if(empty($_GET['redirect'])){
    echo 'USER TYPED IN URL MANUALLY';
}

Thanks