Login Page in Php Undefined index for Android App -


So here's my problem. I have a website and an Android app. My users need to register in the website, There is no need to create a register page in the Android part instead of the login page. But I get an error in login.php whenever I try to run this on the browser whether I am getting the correct response, I get an error Undefined index: Username and Undefined Index: Password I do not know That's wrong. Below is the code for my login.php

  & lt ;? Php included ("config.php"); $ Decoded = json_decode (file_get_contents ("php: // input")); $ Username = $ decode - & gt; {"User name"}; $ Password = $ decode - & gt; {"password"}; $ Query = "Choose from u_id pluma_user where password = '$ password' and user name = '$ user name'"; $ Result = mysql_query ($ query); $ Obj = array (); $ Check = wrong; While ($ line = mysql_fetch_assoc ($ result)) {$ check = true; $ Obj ["result"] = "OK"; $ Obj ["id"] = $ line ["u_id"]; } If ($ check == incorrect) {$ obj ["result"] = "unsuccessful"; } $ Obj1 = array (); $ Obj1 ["result"] = "OK"; Echo json_encode ($ obj); Mysql_close (); ? & Gt;  

Try to detect error

$ result = mysql_query ($ query) or die (__LINE__. "" .mysql_error ());

So if there is an error in the query, the query line and query will show the error code and if you want you can add __ file __ but use it for Is not recommended for security reasons and after mysql_error ending mysql_errno


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -