I am not able to get this to work correctly!!
I have a view.php page that uses a variable of \'ID\' to retrieve db info.
So my url is like this:
Try using empty():
if(empty($_GET['id'])) { header('Location: /'); exit; }
Another way:
if(strlen($_GET['id'])>0) { header('Location: /'); exit; }