基本上提出了一个问题,一些更多的信息,我用这个方法来传递参数给PHP脚本从服务器返回值:
NSString *urlstr = [[NSString alloc] initWithFormat:@"http://www.yourserver.com/yourphp.php?param=%d", paramVal];
NSURL *url = [[NSURL alloc] initWithString:urlstr];
NSString *ans = [NSString stringWithContentsOfURL:url];
// here in ans you'll have what the PHP side returned. Do whatever you want
[urlstr release];
[url release];
然后我提出了这个问题。你如何确保'http://www.yourserver.com/yourphp.php'?您可以轻松导航到相同的脚本(如果您知道路径)并传入任何所需的参数。我错过了什么吗?
用户代理和虚拟PARAMS不会在所有帮助,因为它是微不足道的嗅探这些和使用它们,比方说,一个网页浏览器。你想要类似TK所回答的内容。 – 2009-04-11 13:02:21