CodeIgniter POST variables CodeIgniter POST variables codeigniter codeigniter

CodeIgniter POST variables


You most likely have XSS or CSRF enabled and it will prohibit (guessing here) Paypal to get those details back to you.

This is typical of CodeIgniter, and there are some work arounds like excluding CSRF for certain controllers (via config or hook).

If you give some more details on where the POST is coming from I can answer a bit clearly.

edit

could be that you are calling $this->input->post() incorrectly? I know that CI2.1 added support for $this->input->post() to return the full array, but until this point you had to explicitly define the post variable you wanted ala:

$user = $this->input->post('username');


I resolved the issue with excluding CSRF protection for that particular method

you can add this code in application/config/config.php

if(stripos($_SERVER["REQUEST_URI"],'/Booking/send_instant_to_paypal') === FALSE){    $config['csrf_protection'] = TRUE;}else{    $config['csrf_protection'] = FALSE;}


The only thing I can think of right now is that you maybe did not load the form helper, but I'm not sure if it's being used for that. you can do this in the /config/autoload.php

I for example have this:

$autoload['helper'] = array('url', 'form', 'html', 'site_helper', 'upload_helper');

you can also load it in your function itself as follow:

function send_instant_to_paypal()    {        $this->load->helper('form');        print_r($_POST);        echo '<hr />';        print_r($this->input->post());        echo '<hr />';        $id_booking = $this->input->post('id_booking');        $title = $this->input->post('basket_description');        $cost = ($this->input->post('fee_per_min') * $this->input->post('amount'));        echo $id_booking;        echo $title        echo $cost    }