Welcome Guest, Not a member yet? Register   Sign In
Another "post data mysteriously missing" thread!
#1

[eluser]octavianmh[/eluser]
Hey guys-

So after struggling with this for a few days, I'm just going to give up and post. Smile

Weird issue...I'm using CI to implement a bunch of API-esque functions, which all require post data to process. Requests work just fine via GET. Here's a snippet that's not working:

Code:
class Token extends MY_Controller {

    public $user_tokens;
    public $em;
    public $pa;
    
    public function __construct()
    {
         parent::__construct();
         switch ($_SERVER['SERVER_NAME']) {
          case LOCAL_SERVER_NAME:
            // development server
            $this->em = "[email protected]";
            $this->pa = "password";
            break;
          default:
            // all other servers take from post
            $this->em = $this->input->post('em');
            $this->pa = $this->input->post('pa');
            break;
          }
          echo "post em: ".$this->em;
          echo "post pa: ".$this->pa;
          echo "vars: ".var_dump($_REQUEST);
//deleted code here that actually does something with the data
     }
}

The echo statements return nothing, but work fine if I use GET.

After a bunch of investigation, I've DISABLED CSRF filtering, as I was suspecting that the CURL calls couldn't handle the CSRF token..but that hasn't fixed the issue either.

The result of the var_dump is:

Code:
array(1) {
  ["ci_session"]=>
  string(279) "a:4:{s:10:"session_id";s:32:"c8dc37b12394c4a27be84b06aee14343";s:10:"ip_address";s:14:"184.74.167.227";s:10:"user_agent";s:83:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20100101 Firefox/6.0.2";s:13:"last_activity";i:1316120184;}8cbffb7d0aadaeb8f35e67a26421268e"
}

There's NO .htaccess file in my public folder..so that's not it. Anyone have an idea where I should turn?

Oh, and using 2.0.2.

Argh!




Theme © iAndrew 2016 - Forum software by © MyBB