I am trying to make an iPhone app send a string to my web server. At the moment when I print out $_POST in my php, the array is empty.
This is what I am currently trying;
//NSString *query = @"SELECT name FROM users";
NSString *query = @"select=name&from=users";
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://localhost/www/service.php"]];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[query dataUsingEncoding:NSUTF8StringEncoding]];
[NSURLConnection connectionWithRequest:request delegate:self];
In the php script I simply do print_r($_POST); I get no error messages, only an empty array. What am I doing wrong? I have tried accessing the two fields separately and it does't work either ($POST['select'];)