PHP and Objective C Communication

Posted by meetS on Stack Overflow See other posts from Stack Overflow or by meetS
Published on 2010-04-18T03:10:50Z Indexed on 2010/04/18 3:13 UTC
Read the original article Hit count: 600

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");
                            }

}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c