我在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