NSURL & PHP Connection
i m trying to use this code for objective c connection with php mysql......
NSString *urlstr = [[NSString alloc] initWithFormat:@"http://61.17.213.62/r_o_t/hemen/contactFile/chkbook.php?fname=%@&lname=%@&num=%@&eml=%@",firstname.text,lastname.text,mobile.text,email.text];
NSLog(@"urlstr :%@",urlstr);
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:urlstr] ];
NSLog(@"the request :%@",theRequest);
NSData *returnData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil];
NSLog(@"returndata :%@",returnData);
NSString *listData = [[NSString alloc] initWithData:returnDat开发者_JAVA技巧a encoding:NSASCIIStringEncoding];
NSLog(@"listData :%@",listData);
is there any other way to connect with php mysql....?
There is other way like using ASIHTTPRequest
(http://allseeing-i.com/ASIHTTPRequest/) but it will be almost the same.
- Create the url
- Create the request
- Send the request
- Get data
精彩评论