Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8456605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:35:13+00:00 2026-06-10T12:35:13+00:00

I am getting response from php to android, see below .php <?php $username =

  • 0

I am getting response from php to android, see below .php

 <?php
 $username = $_POST[username];
 $password = $_POST[password];
 if($username == "himm")
 {
if($password == "rangde"){
        echo "success" ;
}
else{
    echo "passwor is wrong.";
}
  }
 else
 {

echo "fail";
  }
  ?>

i am getting success in logcat window of android. But here in android i have made comparison like below,

  BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
  StringBuilder sb = new StringBuilder();
    String line = null;
    while ((line = reader.readLine()) != null) {
           sb.append(line + "\n");
    }
    is.close();
    result = sb.toString();
    Log.v("","Result : "+result);
    Log.v("","this is Result: "+result.equalsIgnoreCase("success"));
    if(result.equals("success")){
        Log.v("","Login successfully......");
}
else{
        Log.v("","Fail to login......");
    }

but in logcat window i see “fail to login” message. Php send response as “success” but which type ?
Here condition of if(result.equals(“success”)) should be true. Please any body give me idea or suggestions to achieve thies……….thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:35:15+00:00Added an answer on June 10, 2026 at 12:35 pm

    sb.append(line + "\n"); modifies the ‘success’ to ‘success\n’ so the if(result.equals("success")){ fails because ‘success\n’ does not match ‘success’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble getting a response from my php jquery / json / ajax.
I am getting ajax response in array format from php url. How to extract
I am getting an ajax response from a PHP. I want to decode the
I am getting response from web service in xml format and data are inside
I am getting the response from a URL and trying to create pdf from
I am getting json response from this google api service to get reverse geo
I am getting JSON response from the server..Inside that JSON string i am having
i'm getting response 503 from Facebook linter while my website is accessible, what went
WebClient.DownloadStringAsync does cache the server response. After once getting a response from the server
I'm trying to POST a http request using ajax, but getting a response from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.