在ajax post请求上获得500内部服务器错误

时间:2017-01-16 15:35:08

标签: php ajax codeigniter

我在upload.setOnSucceeded(e -> { // this code executed when task is successfully completed // this is executed on the FX Application Thread, so you can // safely modify the UI }); 帖子请求中收到500内部服务器错误。我在localhost上测试它,我的路线也准确。

我已经为此调用编写了路由,而不是在url中调用控制器名称和方法。

我的代码如下,任何帮助都将不胜感激。

ajax

我的PHP代码是:

$('#personal-info').click(function(){
    //  Var paramstr = $("#personal-info").serialize();
     var form_data = {            //repair
            firstname: $('#firstname').val(),
            lastname: $('#lastname').val(),
            fathername: $('#fathername').val(),
            cnic: $('#cnic').val(),
            gender: $('#gender').val(),
            marital_status: $('#marital_status').val(),
            day_of_birth: $('#day_of_birth').val(),
            month_of_birth: $('#month_of_birth').val(),
            year_of_birth: $('#year_of_birth').val(),
            email: $('#email').val(),
            phone: $('#phone').val(),
            postal_code: $('#postal_code').val(),
            country_id: $('#country_id').val(),
            state_id: $('#state_id').val(),
            industry_id: $('#industry_id').val(),
            experienc_level: $('#experienc_level').val(),
            current_salary: $('#current_salary').val(),
            expected_salary: $('#expected_salary').val(),
            salary_currency: $('#salary_currency').val(),
            address: $('#address').val(),
            skype: $('#skype').val(),
            professional_summary: $('#professional_summary').val(),
            face_book: $('#face_book').val(),
            twitter: $('#twitter').val(),
            linkedin: $('#linkedin').val(),
            blog: $('#blog').val(),
            website: $('#website').val(),
            // created_at: $('#created_at').val()
        };


    $.ajax({
        url: "<?php echo base_url('add_personal_info'); ?>",//repair
        type: 'POST',
        data: form_data, // $(this).serialize(); you can use this too
        success: function(msg) {
              alert("success..!! or any stupid msg");
        }

   });
   return false;

});

2 个答案:

答案 0 :(得分:0)

我认为你可以提升浏览器的信息,或者你可以查看Nginx / apache的错误.log 在Linux中,您可以使用命令locate error.log来查找error.log

答案 1 :(得分:0)

这可能是因为您的 php 基础文件权限。 尝试更改权限:

  • 将您的“base_url('add_personal_info')”文件和所有其他基本文件权限更改为 644。
  • 将他们的文件夹权限更改为 755。
相关问题