I created the following POST method via objective-C
-(IBAction) postLocation: (id) sender{ NSString *latitude = @"37.3229978"; NSString *longitude = @"-122.0321823"; NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.mydomain.me/webservice.php"]]; [request setHTTPMethod:@"POST"]; NSString *post =[[NSString alloc] initWithFormat:@"latitude=%@longitude=%@submit",latitude,longitude]; [request setHTTPBody:[post dataUsingEncoding:NSUTF8StringEncoding]]; NSURLResponse *response; NSError *err; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err]; }
and my php code:
if (isset($_POST['submit']){
The question is why PHP code cannot get into the if statement? Where can I specify 'submit' via objective-C?
source share