PHP and Objective C Communication
- by meetS
Hii, I have PHP script link,which responds YES or NO when we set post userName and emailID.I have used ASI framework. But it is not working....Here is my code....Thanks in advance...
**NSURL *url = [NSURL URLWithString:@"https://abc.com/abctest/registration.php"];
ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url];
[request setPostValue:@"[email protected]" forKey:@"email"];
[request setPostValue:@"pqr" forKey:@"ebayName"];
[request start];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
printf("\n\n\n Responce %s",[response UTF8String]);
response = [response stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([response isEqualToString:@"YES"])
{
printf("\n\n YES");
}
}