gpt4 book ai didi

java - 我正在尝试使用 Android 界面登录 php 网站,但我不知道如何发送数据

转载 作者:行者123 更新时间:2023-12-02 07:44:19 25 4
gpt4 key购买 nike

我正在尝试登录网站并取回代码,但收到“密码或登录无效”消息,但我确信它们都没有问题

这是我的代码的一部分:

        HttpPost httppost = new HttpPost("http://www3.mackenzie.com.br/tia/index2.php");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("username", username));
nameValuePairs.add(new BasicNameValuePair("password", password));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
String str = inputStreamToString(response.getEntity().getContent()).toString();

我正在尝试访问此页面: http://www3.mackenzie.com.br/tia/index2.php

我不确定是否应该输入“用户名”和“密码”或其他内容?我怎样才能识别它?我的问题可能是什么?

感谢您的帮助=)

最佳答案

对Maxwell Weru的答案稍作修改,我相信他的网址是错误的。 & 添加了一个参数。

HttpPost httppost = new HttpPost("http://www3.mackenzie.com.br/tia/verifica.php");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("alumat", username));
nameValuePairs.add(new BasicNameValuePair("pass", password));
nameValuePairs.add(new BasicNameValuePair("unidade", "001"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

关于java - 我正在尝试使用 Android 界面登录 php 网站,但我不知道如何发送数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11108330/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com