http - $_POST variable empty in php -


i saw few posts here have same problem none of them simple mine , hence post.

i new php , see $_post , $_request variable both empty. can headers using apache_request_headers() , able see headers properly. it's $_post variable empty.

my client android app , generating post message properly. used tcpdump test it. apache logs show intended php invoked. use apache 2.2.14 , php 5.2.12 standard installation, nothing special.

can think of reason why $_post variable empty?

also not using class in code. plain code calls functions other classes needed. mention because saw post suggests use $this->input->post() not possible in case.

edit: found problem sean below. "content-type" not set , caused actual values not reaching php code. oddly enough headers of empty request set them to. why data stripped?

make sure android client sending correct content type on post. should set application/x-www-form-urlencoded.

        url = new url("your url");         connection = (httpurlconnection) url.openconnection();         connection.setdooutput(true);         connection.setrequestproperty("content-type", "application/x-www-form-urlencoded");         connection.setrequestmethod("post"); 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -