使用HttpURLConnection
从服务器中的android
到.php
文件发送变量。我有一个奇怪的问题,我不知道如何解决它。
这种方式有效:
for(int i=1; i<parameters.length; i++) {
postDataParams.put("userInfo" , parameters[i]);
}
$userInfo=$_POST['userInfo'];
但是我需要发布尽可能多的变量并且它不起作用:
for(int i=1; i<parameters.length; i++) {
postDataParams.put("userInfo"+i , parameters[i]);
}
$userInfo=$_POST['userInfo1'];