i'am tring to login into website with post method ... to right here the code is code but the response always give me 200 ... i want to know if i logged in successfully with the right username and password or not !!! ... also if i removed permitAll() it give me networkonmainthreadexception
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
@SuppressLint("NewApi")
private void sendPost() {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://svuonline.org/isis/login.php?");
String user=username.getText().toString();
String pass=password.getText().toString();
String fpage="/isis/index.php";
/* if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}*/
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("user_name", user));
nameValuePairs.add(new BasicNameValuePair("user_pass", pass));
nameValuePairs.add(new BasicNameValuePair("user_otp", null));
nameValuePairs.add(new BasicNameValuePair("from_page", fpage));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
String Rcode=response.toString();
Toast.makeText(getBaseContext(), Rcode+"", Toast.LENGTH_LONG).show();
} catch (ClientProtocolException e) {
Toast.makeText(getBaseContext(), e+"", Toast.LENGTH_LONG).show();
} catch (IOException e) {
Toast.makeText(getBaseContext(), e+"", Toast.LENGTH_LONG).show();
}
}