我在网站上种植EAR个错误。为此,我想撤消我执行的php头重定向。示例: -
if(!admin())
{
header('Location: www.example.com/non-admin.php');
}
//Some code to undo the redirect happened above
通过撤消上面发生的重定向,它将是易受攻击的。那么有没有可以撤消重定向的机制?
答案 0 :(得分:1)
请参阅header_remove
函数documented on PHP.net
header_remove("Location");
如果您使用的是PHP< 5.3,您还可以将header
函数传递给第二个参数
header('Location: ', true);
请注意,标头是在第一次输出之前发送的。通过致电headers_sent()