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

Eric Uche • 6 years ago

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

jakdu • 4 years ago

you have to see your host and ,user_name , password and so on

Duke Duke • 7 years ago

hi when i registed, i will get the the error {"tag":"register","success":0,"error":1,"error_msg":"JSON Error occured in Registartion"} Could u tell me how to fix it? Thank you

Jaydeep Bhayani • 7 years ago

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

{
"operation":"register",
"user":{
"name":"Raj Amal",
"mobile":"124213"
"email":"raj.amalw@learn2crack.com",
"password":"rajamalw"
}
}

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

Oliver • 6 years 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.

Swapnil Gawali • 8 years ago

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

Luís Cunha • 8 years ago

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

Ali O. Al-Souqi • 7 years ago

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

sunil kumar • 7 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 • 6 years ago

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

Prateek Sharma • 6 years 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

Ayushi Mundra • 6 years ago

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

Raj Amal • 6 years ago

Can you post the error message

Lloyd Ramos • 6 years ago

https://uploads.disquscdn.c...

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 • 6 years ago

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

RAHUL SAH • 6 years ago

any1 solved it pls rply

praveen singh • 7 years ago

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

Rahul Rajputh • 7 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 • 7 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 • 5 years ago

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

Fazrian Ramadlan Sumarna • 5 years 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 • 5 years 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 • 5 years 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

https://uploads.disquscdn.c...https://uploads.disquscdn.c...

zohaib hassan • 6 years ago

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

Sabarish Don • 6 years ago

how to get functions

Aliasgar Lokhandwala • 6 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 • 6 years 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 • 6 years 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 • 6 years ago

See my answer above.

Armand • 6 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:
http://127.0.0.1/learn2crack-login-register

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

from
http://127.0.0.1/learn2crack-login-register
to
http://127.0.0.1/learn2crack-login-register/

Fixed my error

Aliasgar Lokhandwala • 6 years ago

Hi Raj,

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

Abdulkarim Khorajiya • 6 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 • 6 years ago

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

amreky2005 • 6 years ago

Thanks very much for sharing this!!

I just have a quick question if someone can help:

Using postman when I input:

{
"operation":"register",
"user":{
"name":"Raj Amal",
"email":"raj.amalw@learn2crack.com",
"password":"rajamalw"
}
}

And I do get a successful reply:

{
"result":"success",
"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 • 7 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:
{

"user":{
"email":"raj.amalw@learn2crack.com",
password":"rajamal",

}
}

Yusuf Charles • 7 years ago

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

Raj Amal • 7 years ago

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

Yusuf Charles • 7 years ago

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

Yusuf Charles • 7 years ago

sendEmail()

Weikai • 6 years ago

Hi, did you solved the problem ?

Raj Amal • 7 years ago

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

Weikai • 6 years ago

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

Weikai • 6 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 • 7 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 • 7 years ago

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

anmolsharma • 7 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 • 7 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 • 7 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 • 7 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 • 6 years ago

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