I'm building an iOS
app using Xcode
. In that, I need to get a value from an online php page
: index.php.
I don't know how to do that. I've tried the following:
NSString *urlstr = [[NSString alloc]
initWithFormat:@"http://www.mediafire.com/edit/l8lba665t24h3dg/index.php"];
NSURL *url = [[NSURL alloc] initWithString:urlstr];
NSString *ans = [NSString stringWithContentsOfURL:url
encoding:NSASCIIStringEncoding
error:nil];
NSLog(@"ans--------->%@",ans); // This returns the whole page :(
[urlstr release];
[url release];
Is it is the right way to do this? Then how to get the return string? I need the return string only as: "Hello, PHP!"
(ie., the php output). Please, please help me...