通常在覈心php中,如果我們嘗試使用ajax發出請求,我們會設置存在查詢的文件的url,因此在codeigniter中切換相同的進程時,我得到了一個響應錯誤,任何人都可以幫助我出此錯誤我在codeigniter中出現錯誤
網:: ERR_SSL_PROTOCOL_ERROR
這裏是我的代碼 的Javascript AJAX
$.ajax ({
type : "POST",
url : "https://localhost:90/tufuturo/home/register",
data : {username: username, email: email, password: confirm_password},
dataType : "text",
success : function(data, text, xhr) {
if(xhr == 200) {
var return_data = data;
$('#messagebox').fadeIn(2000, function() {
$(this).html("<div class='message'>"+return_data+"</div>").delay(4000).fadeOut(3000);
});
}
}
});
這裏是代碼的形式我Home.php控制器
public function register() {
$this->load->library('form_validation');
$this->form_validation->set_rules('username', '', 'required|trim|is_unique[users.username]');
$this->form_validation->set_rules('password', '', 'md5|trim');
if($this->form_validation->run()) {
$data = array(
'username' => $this->input->post('username'),
'password' => $this->input->post('password'),
'email' => $this->input->post('email'),
'type' => 'user'
);
$this->data_insert->add_admin($data);
echo 'New admin has been successfully created';
} else {
echo 'Username already taken';
}
}
請讓我知道我怎樣才能擺脫這種錯誤的
爲什麼在本地系統中使用https? –