在ios中向php脚本发送参数

在ios中向php脚本发送参数,php,objective-c,ios,Php,Objective C,Ios,我有一个php脚本,我想发送参数给它。在android中,我成功地使用了该代码: 你能帮我用Obj-C中的等效代码吗 nameValuePairs.add(new BasicNameValuePair("table", table)); nameValuePairs.add(new BasicNameValuePair("code", Integer.toString(code))); nameValuePairs.add(new BasicNameValu

我有一个php脚本,我想发送参数给它。在android中,我成功地使用了该代码:

你能帮我用Obj-C中的等效代码吗

 nameValuePairs.add(new BasicNameValuePair("table", table));
         nameValuePairs.add(new BasicNameValuePair("code", Integer.toString(code)));
         nameValuePairs.add(new BasicNameValuePair("name", temp_name));
         nameValuePairs.add(new BasicNameValuePair("email", email));
我知道如何从php获取数据或调用http脚本,只是不知道如何将这些参数发送到php

在php方面,我的代码如下:

$table.=$_POST['table'];
$code.=$_POST['code'];
$name.=$_POST['name'];
$email.=$_POST['email'];

证据就在布丁里:

不过,我建议您使用
NSDictionary
对象来保存您的值和JSON编码。获取JSON数据并将其提交到服务器。在PHP脚本中使用JSON解码来解码和处理结果