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/elsestatement, albeit confusing sometimes, they are handy to save time and space. Read the above as: assign$came_from_sitethe return value of$_GET['redirect']ifisset($_GET['redirect'])evaluates totrue. Else, set$came_from_sitetonull.