Post by haosmark » Sun Dec 30, 2012 9:34 am

Code: Select all

function submitSettings() {
    $('.forms').each(function() {
        posted = $(this).serializeArray();
    });
    console.log(posted);
    console.log('<?php echo $this->session->data["token"]; ?>');
//    $.post('<?php echo $action; ?>', posted);

    $.ajax({
        type: 'POST',
        url: 'index.php?route=module/my_module/test&token=<?php echo $this->session->data["token"]; ?>',
        data: posted,
        dataType: 'json',
        success: $('#text-me').html(<?php echo $success; ?>),
        error: function(jqXHR, textStatus, errorThrown){
            // log the error to the console
            console.log("The following error occured: " + textStatus, errorThrown);
        }
    });
}
I'm collecting a bunch of data of forms then send them to test function, but I'm receiving "500 (Internal Server Error) "
test() is located right after index() and this is what it looks like:

Code: Select all

    public function test() {
//        $this->load->library('json');
//        $json['success'] = 'This is the returned results from color_adjust.php';
        $this->data['success'] = 'This is the returned result';
        $this->response->setOutput($this->render());
    }

New member

Posts

Joined
Wed Oct 10, 2012 1:59 am
Who is online

Users browsing this forum: No registered users and 6 guests