I want to send some data to my php page, php page is located into a different system and I want to call that page from my iPad app....how can I make this connection so that I can call php page from my app and what will be the connection string for it..Kindly describe in detail. Thanks in advance
You can try to diagnose the problem by taking the following steps:
1) Make sure that your iPad and located system are connected with same network.
2) Get IP address from located system (eg IP :121.127.1.4)
3) And try this following code:
NSURL *url = [NSURL URLWithString:@"http://121.127.1.4/webservices.php"];
NSData *postDatastr = [NSData dataWithBytes:[postStr UTF8String] length:[postStr length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init] ;
[request setURL:[NSURL URLWithString: SignUpConnection_server]];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:postDatastr];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
// Create Connection.
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (conn) {
resposeData = [[NSMutableData alloc] init];
}
else
{
NSLog( @"Data could not be received from: %@", request.URL );
}
If you want to use native ios app you should use web-service for that.