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
精彩评论