我在codeigniter框架中使用cloudflare,并且在操作完成时尝试将脚本重定向到另一个页面时遇到奇怪的问题,服务器使用抛出错误520(cloudflare server)重定向在php中抛出520错误CloudFlare
$input = $this->input->post();
if(!empty($input)){
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required|email');
$this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() == TRUE)
{
$r = $this->userModel->login($input["email"], $input["password"]);
if($r["success"] == "t"){
$this->userModel->setSession($r["_user_id"], $r["token"]);
//Both redirect methods does not works
//echo '<html><head><META http-equiv="refresh" content="0;URL='.$this->glob->exec_redirect().'"></head><body></body></html>';
redirect($this->glob->exec_redirect());
die();
}else{
$data["errors"] = $r["message"];
}
}else
$data["errors"] = validation_errors();
}
$this->load->view("user/login", $data);
此脚本工作正常,没有cloudflare,也没有重定向功能的脚本工作良好的cloudflare。 演示:
用户:测试
通:TEST12
有时候你应该尝试更多的再一次崩溃
工作正常,用户登录只需重定向曼努埃尔。
问候。
尝试删除'die()'? – w00d 2014-12-01 16:52:46
我做到了,它没有工作 – 2014-12-01 17:05:28