I’m trying to log into a site and obtain the code back, but i’m getting “invalid password or login”, but I’m sure they are both ok
here’s part of my code:
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();
I’m trying to acess this page:
http://www3.mackenzie.com.br/tia/index2.php
I’m not sure if I should put “username” and “password” or something else? how can I identify that?
what could be my problem guys?
thanks for your help =)
Slight modification on Maxwell Weru’s answer, I believe his url is wrong. & added one param.