开发者

CakePHP Undefined index when looking for query string

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜