Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我在codeigniter中遇到错误_Javascript_Php_Ajax_Codeigniter - Fatal编程技术网

Javascript 我在codeigniter中遇到错误

Javascript 我在codeigniter中遇到错误,javascript,php,ajax,codeigniter,Javascript,Php,Ajax,Codeigniter,通常在核心php中,如果我们尝试使用ajax发出请求,我们会设置存在查询的文件的url,因此在codeigniter中切换相同的进程时,我在响应中遇到了一个错误,有人能帮我解决这个错误吗 net::ERR\u SSL\u协议\u错误 这是我的密码 Javascript-ajax $.ajax ({ type : "POST", url : "https://localhost:90/tufuturo/home/re

通常在核心php中,如果我们尝试使用ajax发出请求,我们会设置存在查询的文件的url,因此在codeigniter中切换相同的进程时,我在响应中遇到了一个错误,有人能帮我解决这个错误吗

net::ERR\u SSL\u协议\u错误

这是我的密码 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);
                        });
                    }
                }
            });

请告诉我如何消除此错误

您的本地主机不符合
https
协议

将url从
https://localhost:90/tufuturo/home/register
到<代码>http://localhost:90/tufuturo/home/register


如果你想使用https协议,你需要使用SSL(https),也许你需要从你的url中去掉:90。

为什么在本地系统中使用https?你可以在端口
90
上使用
https
,默认值是
443
,但你可以监听任何你想要的端口(只要它可用)我之所以使用90是因为skype如果我运行skype wamp server stops,这就是为什么我将端口更改为90当我将https更改为http时,现在什么都没有发生,我应该删除http吗?不,你确定你正在收听的端口
90
吗?是的,我如何验证我是否收到任何响应?控制器是否会回显工作?它是否会给我们响应?是的,我确信当我直接从浏览器运行文件时,它正在工作版本是3.0是我正在使用的版本,你确定你设置了转换url的设置吗?它不会自动转换为/controller/method,默认值为
index.php?/controller/method
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';
        }
    }