在Codeigniter 4中通过模型的insert函数插入数据在执行Ajax发布请求时显示内部服务器错误

问题描述

我是Codeigniter 4的新手,我正在尝试通过jquery的$ .post函数保存数据。

这是我的jquery上的代码

all()

这是我的Customer Controller类上的代码

if not any(lst)
   print("something")

这是我在客户模型上的代码

$(document).ready(function(){

    let baseUrl=window.location.origin;

  

    $("#sign-up-form").submit(function(e){
        e.preventDefault();
        const data=$(this).serialize();

        $.post(baseUrl+"/sign-up/customer/save",data,function(response){
            console.log(response);
        })
    
    })


})

提交表单时,我的控制器仅响应ajax请求并显示内部服务器错误500。我不知道如何使用它。

我不确定如何从这里出发。预先感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)