if(!isset($_GET['set']) && (($_GET['set'] != 'on') || ($_GET['set'] != 'off'))){
header('Location: http://google.com');
exit;
}
Run Code Online (Sandbox Code Playgroud)
我要检查的是,如果设置未设置且值未打开或关闭.这是对的还是有其他方法吗?
不,你需要的只是这个:
if(!isset($_GET['set'])){
header('Location: http://google.com');
exit;
}
Run Code Online (Sandbox Code Playgroud)