We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Eric Uche • 1 year ago

my app is not connecting to database. it keeps showing "connect timed out"

Swapnil Gawali • 3 years ago

how to devide functions to seperate file. like register.php & login.php?

Jaydeep Bhayani • 2 years ago

hii sir,
I'm not able add more column in this php service can you tell me the problem

"name":"Raj Amal",

{"result":"failure","message":"Invalid Parameters"}

Oliver • 1 year ago

did you solve this problem? please share if you do here's my email nwanime@gmail.com Your response is deeply appreciated. Thanks in advance.

Luís Cunha • 3 years ago

Nice to see this article updated. I has served me well when I was just starting my career.

Ali O. Al-Souqi • 3 years ago

hi>>can you tell me how can i run this app|?

sunil kumar • 2 years ago

It's so easy..
import codes in android studio.
Install a wamp server for run php script.
url like . localhost/php_api
and database url is localhost/phpmyadmin

zohaib hassan • 1 year ago

in constants java file how we connect link of php file .can we set ip adress ?

Prateek Sharma • 1 year ago

hello i just run the code . when i am clicking on register button i am getting response in snackbar like this :status , header is missing but data is entering in mysql

praveen singh • 2 years ago

anyone can help me to direct login(admin login) with our database through android app ....

Rahul Rajputh • 2 years ago

hey guys if you get ---Invalid Parameters--- or invalid password_hash ERROR
the try this code on DBOperations.php it is work for me,,, replace the code from line no.117. https://uploads.disquscdn.c...

public function getHash($password) {

$salt = sha1(rand());

$salt = substr($salt, 0, 10);

$encrypted = $salt ;

$hash = array("salt" => $salt, "encrypted" => $encrypted);

return $hash;


public function verifyHash($password, $hash) {

return $password.$hash;



ßlack Wizard • 2 years ago

Hello can you tell me how can i use my database
Its look like this

`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_login` varchar(60) NOT NULL DEFAULT '',
`user_pass` varchar(255) NOT NULL DEFAULT '',
`user_nicename` varchar(50) NOT NULL DEFAULT '',
`user_email` varchar(100) NOT NULL DEFAULT '',
`user_url` varchar(100) NOT NULL DEFAULT '', ( not needed)
`user_registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',(not needed)
`user_activation_key` varchar(255) NOT NULL DEFAULT '',(not needed)
`user_status` int(11) NOT NULL DEFAULT '0', (not needed)
`display_name` varchar(250) NOT NULL DEFAULT '',

ibrahim • 9 months ago

How do I do these codes in my android project?
please help me ibrahimcss@outlook.com

Fazrian Ramadlan Sumarna • 1 year ago

hi, i have try create api for android apps android studio, when the api in the localhost, it run normally. but when i move the api to the cpanel, the android apps wont login. can u help me? thx.. u can email me fajriramsu@gmail.com. thx a lot

Amruta Patil • 6 months ago

hi, even i facing the same problem did u get the solution.? can u help me? please mail me at amrutapatil599@gmail.com. Thank you

Bulbul Hossen • 1 year ago

How can I solve this problem, please help sir
Two Problem show
* Registration is done, but when you log in, this warning message shows
* when password reset , this warning massage show


zohaib hassan • 1 year ago

where is autoload.php file in ths phpMail autolodfile miss. but in function.php file you have add require this file.

Ayushi Mundra • 1 year ago

I need help that I want to reset the password . Getting Error in Library importing . Help me out .

Raj Amal • 1 year ago

Can you post the error message

Lloyd Ramos • 1 year ago


Please help me. I used this tutorial to my thesis very helpful but i can't fixed it. please help me sir. Thank you so much!!!

Mahantesh Gurav • 1 year ago

Did you solve this? I also have the same problem.

RAHUL SAH • 1 year ago

any1 solved it pls rply

Sabarish Don • 1 year ago

how to get functions

Aliasgar Lokhandwala • 2 years ago

Hi All,

Has anyone solved this problem?

Use JsonReader.setLinient(true) to accept malformed JSON at line 1 column 1 path$

Edgar Valdés • 1 year ago

In my case, it was a problem with utf8 encoding. In the file DBOperations.php, I added the utf8 charset.

$this -> conn = new PDO("mysql:host=".$this -> host.";dbname=".$this -> db, $this -> user, $this -> pass,array('charset'=>'utf8'));

$this -> conn -> query("SET CHARACTER SET utf8");

Suraj Giri • 1 year ago

yes I am having the same problem . Please do tell me and explain me how to resolve it if you have resolved it earlier

Edgar Valdés • 1 year ago

See my answer above.

Armand • 2 years ago

Hi for those that had the same problem as me I just came across my error. I had everything working as I was working with a cpanel site however when I tried testing the web service it kept on only showing: "Learn2Crack Login API". This was by using postman as per guidance from video tutorial. I had my path set as:

however after 2 days I discovered that I had a missing "/" and by adding that my path worked correctly and I succeeded as per video


Fixed my error

Aliasgar Lokhandwala • 2 years ago

Hi Raj,

Great tutorial. Can you please show if we can use DBoperations with MSSQL.

Abdulkarim Khorajiya • 2 years ago

how to insert record after verify otp.

If first time i am register but without verify otp i go to the main activitu by pressing the back button.

While i register 2nd time.
email is already in use. Message arrive. My logic is if user not verify then record not insert on database.

how to implement?

Priyansh Mishra • 2 years ago

how to register with this , what is the path or url ?and what fields to be put into postman

amreky2005 • 2 years ago

Thanks very much for sharing this!!

I just have a quick question if someone can help:

Using postman when I input:

"name":"Raj Amal",

And I do get a successful reply:

"message":"User Registered Successfully !"

But when I check on the users created in phpmyadmin database there is nothing there. Any suggestions on what is causing this?

If I try to login as a user it fails indicating that nothing indeed was added to the database.

Any help will be very appreciated!!

Isaoshi Aoki • 2 years ago

Hello Raj Amal.
Excellent tutorial. Thank you very much for sharing. But I have a question how can I send json in another way like this:



Yusuf Charles • 2 years ago

i cannot see the mail for reset password after requesting a password reset. I am using my computer IP address ( i checked my gmail several times but not found. Please help.

Raj Amal • 2 years ago

What function you are using to send Email ? sendPHPMail() or sendEmail() ?

Yusuf Charles • 2 years ago

sendPHPMail returns error
Use JsonReader.setLinient(true) to accept malformed JSON at line 1 column 1 path$

Yusuf Charles • 2 years ago


Weikai • 2 years ago

Hi, did you solved the problem ?

Raj Amal • 2 years ago

Have you entered the email and credentials in the sendEmail() function ? If entered have you checked in the spam folder ?

Weikai • 2 years ago

MR. RAJ AMAL, can you anser my question and I didnt see any sendEmail() or sendPHPMail() in your code !

Weikai • 2 years ago

Hi, I am currently facing the same problem as above :(

Use JsonReader.setLinient(true) to accept malformed JSON at line 1 column 1 path$

What does this actually means ?

Mohammad N • 2 years ago

Hi Raj, how can i show message for utf-8 ?
I change message text for my language (utf-8) but not show and just show  575;&# 1610;& #1606;  75;& #1610; 05;ي& #16 04; ق ;ب& # 1604;ا

how can i fix it?

Parimal Debbarma • 2 years ago

Very nice tutorial.It works fine.But I have a problems.How to start activity with a button from ProfileFragments.

anmolsharma • 2 years ago

"" Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ ""
getting this error after click on forgot password.... how to resolve

ahmad • 2 years ago

hello ...
please how can i edit the "php:// input" ??
i want to add a number text field in the registartion code ...

Raj Amal • 2 years ago

You can fetch the additional JSON object in PHP by

$newField = $user -> newField;

And while sending you need to add that field as JSON object to the existing JSON.

ahmad • 2 years ago

okii then how can i add number field in the jason ??
i update the database and the php files and the java code but i have thi error when i click on the register button !!
"" Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ ""
pleaaaaase help me what can i do to fix that !!

Weikai • 2 years ago

I got same error as you. Did you solved the problem ?

Trynos Tira Munya Much • 2 years ago

The app keeps on crushing please help and i need the libs for retrofits2.....how can i use volley and remove retrofits?please can you do the tutorials for volley in the same app.

Thanks Raj!!!

B3NN1TH • 2 years ago

Had issues where i was getting invalid parameters ... make sure to have index.php in the @POST request.
Also I upgraded to PHP5.6 from PHP5.59 but not sure if that also helps... probably just a case of the @POST

Call<serverresponse> operation(@Body ServerRequest request);