Database connection through PHP & HTTPS for iPhone -
would sufficient data through https connection iphone app via php (the php files located on same web server mysql database)?
i'm speaking in terms of security.
also, tideous process (with many overheads) or can work in terms of performance?
thanks in advance.
i have added http authentication security scheme describe--so directory containing php scripts receive web requests iphone app , emit json in return behind basic web-server-level authentication. not lot stronger, @ least prevents nosy url-twiddlers finding way in there.
i recommend following third-party libraries this:
asihttprequest
json framework
using 2 things, -viewdidload
method might contain this:
nsstring *urlstr = @"http://username:password@myrequest.com/myjsonscript.php"; asihttprequest *r = [asihttprequest requestwithurl: [nsurl urlwithstring:urlstr]]; [r setcompletionblock:^{ nsdictionary *results = [[r responsestring] jsonvalue]; //do whatever display background-downloaded data //(possibly [self.tableview reloaddata] or that) }]; [r startasynchronous];
just simple.
Comments
Post a Comment