duanbi3786 2016-05-17 08:04
浏览 38
已采纳

我在codeigniter中遇到错误

Normally in core php if we try to make a request using ajax we set url of the file where the query exist so when switching same process in codeigniter but I got an error in response can anyone help me out with this error

net::ERR_SSL_PROTOCOL_ERROR

here is my code 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);
                        });
                    }
                }
            });

Here is the code form my Home.php controller

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';
        }
    }

Please let me know how can i get rid of this error

  • 写回答

2条回答 默认 最新

  • doukuipai8544 2016-05-17 08:07
    关注

    Your localhost is not conforming https protocol

    Change the url from https://localhost:90/tufuturo/home/register to http://localhost:90/tufuturo/home/register

    If you want to work with https protocol you need to generate certificate

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示