我有注册形式,我有像名字,姓氏,性别,电子邮件,密码,用户形象,年龄等字段。我想通过parameters call.how将这个用户信息保存在服务器上,我能传递这些参数来服务url吗?我会使用http请求使用post方法将用户信息保存到服务器,当该用户希望登录iOS应用程序时,我可能会匹配该用户的信誉。在岸上,我需要登录并注册我的iOS应用程序的屏幕,请给我推荐任何教程。
预先感谢你们所有人
发布于 2013-08-01 13:33:47
首先,需要nto创建php脚本,然后通过NSURL传输数据。
NSURL * url=[NSURL URLWithString:[NSString stringWithFormat:@"http://192.168.0.6/savedevicedata.php?Udid=%@&Flag=%d&DateTime=%@",uniqueIdentifier,Flag,FinalDate]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSLog(@"%@",request);
[request setHTTPMethod:@"POST"];
//[request setHTTPBody:[NSString stringWithFormat:@"%@",rawStr]];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSLog(@"responseData: %@", responseData);尝试此代码只替换您的字段。
https://stackoverflow.com/questions/17995439
复制相似问题