我正在關注視頻tutorail在線發送數據到一個php文件,然後將其存儲在數據庫中。發送數據Iphone到PHP NSUTF8StringEncoding
我真的很困惑它如何工作作爲theres不張貼?它只是從變量收集信息。我幾個YouTube的評論說同樣的事情,但一些他的作品?
到目前爲止我的代碼...
- (IBAction)Submit:(id)sender {
NSString *strURL = [NSString stringWithFormat:@"http://www.bigwavemedia.co.uk/ios/contact.php?name=%@", nameField.text];
//to execute php code
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
NSString *strRes = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
NSLog(@"%@", strRes);
}
當我點擊提交按鈕,埃文但其拉上我沒有得到任何迴應?
http://www.youtube.com/watch?v=LwCyaGoRNWM – Brent 2013-03-06 14:18:56
通過get方法或post方法檢查數據gat到php? – iPatel 2013-03-06 14:28:38
的PHP是好的,我只需要制定出什麼添加到此代碼的末尾發送字符串一次提交已被按下。 – Brent 2013-03-06 14:29:50