Welcome Guest, Not a member yet? Register   Sign In
Post method not working in Codeigniter
#10

[eluser]vikas.fourorange[/eluser]
Managed to find the solution. The problem was due to CI_TOKEN which is sent with the FORM. That was absent and due to which POST method was giving 500 Internal server Error. I added following in my view file.

Code:
<?php echo form_open_multipart(); ?>
<?php echo form_close(); ?>
and sent ci_token with the ajax post request.
Code:
var ci_token = formObj.find('input[name=ci_token]').val();
var qty = 1;
var dataString = 'product_id='+ id + '&quantity;=' + qty + '&ajax;=' + 1
+'&ci;_token=' + ci_token;

This solved the problem. I am not sure but this is called CSRF related some problem

Thanks


Messages In This Thread
Post method not working in Codeigniter - by El Forum - 06-28-2012, 05:50 AM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 07:32 AM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 10:26 AM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 10:41 AM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 10:51 AM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 01:26 PM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 10:03 PM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 10:53 PM
Post method not working in Codeigniter - by El Forum - 06-28-2012, 11:00 PM
Post method not working in Codeigniter - by El Forum - 07-05-2012, 12:10 AM
Post method not working in Codeigniter - by El Forum - 07-05-2012, 02:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB