I having an issue from my HTTP Post.
The code I’m using are working (have tested to post data to a guestbook form and it worked).
Now what I want. I have created two EditText forms, that holds values. I have a submit button there I post this data (like the test I wrote about before), but now I want to post it into a login.php page (that in a normal browser redirects me to the member.php page).
Although I know the forms are correctly filled in and it successfully posted on the “test” site, I wanna get the response from login.php and check if the user is successfully logged in or if it failed, if succeeded -> redirect me to member.php page.
All I know is this:
HttpResponse response = httpclient.execute(httppost);
that executes the command. But how should I achieve the login check? Any further use of the response variable?
Well… your approach is not good at all. If you are going to allow user authenticate through your app, why do you want to redirect the user to a member.php page? why don’t you just put the login form in a login.php file on the server and make the user browse through your site?
As user, if an app allows me to authenticate using
EditTextsinside UI, I would expect to access all the content through the app instead of being redirected to a web interface.Anyway, if you decide to continue doing it that way keep in mind that you would have to parse and process cookies manually, and inject them into the WebView (Google about the
CookieManagerclass). That’s the way how the user will really be logged-in in your web app.Here you have:
How do you use it? Something like this:
I’m here supposing that you have something like this in your PHP code: