我在代码点火器中出错
I am getting error in codeigniter
通常在core php中,如果我们试图使用ajax发出请求,我们会设置查询所在文件的url,因此当在codeigniter中切换相同进程时,但我在响应中出现错误,有人能帮我解决这个错误吗?
net::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
协议
更改https://localhost:90/tufuturo/home/register
的url至http://localhost:90/tufuturo/home/register
如果您想使用https
协议,您需要生成证书
如果你使用SSL(https),也许你需要从你的url中去掉:90。
相关文章:
- javascript中的数组出错
- 节点Js:How to catch a“;没有这样的文件或目录“;读取线模块出错
- 在Meteor项目中安装并包含npm模块后出错
- 解析JSON并从中删除对象会出错
- AngularJS指令出错-无法读取属性'编译'的未定义
- 使用javascript在MVC中查找网格长度时出错
- 尝试调用AngularJS上的函数时出错
- Google 脚本:用于创建日历活动的脚本运行时不会出错,但不会执行任何操作
- 全局安装gull后出错
- 我在代码点火器中出错
- Java脚本将URL转换为已保存的URL时出错
- Backbone.js将模型绑定到视图时出错
- 将javascript代码转换为jquery代码时出错
- 加载db.json时出错
- 在运行时创建元素时移到一边时出错
- 如何检查这个代码点火器php函数是否工作,该函数是否在ajax url中使用
- 失败:等待Protractor与页面同步时出错:“”;在窗口上找不到角度”;
- 重置表单字段时出错
- 将对象的列表c#传递给javascript:undefined变量时出错
- 否'访问控制允许来源'HMVC代码点火器出错