Skip to content
Advertisement

org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject

I m trying to do a registration page from an android activity connectiong the datas to my sqldatabase, I m getting this error ” org.json.JSONException: Value

First of all, could anyone advise me on how to debug my program when using an mysql database with php script for an android application ? Cause I usually use the log cat but here the errors aren’t as clear :S …

Here is the activity code :

JavaScript

and here is the php script :

JavaScript

Advertisement

Answer

Thanks I manage to correct some of the errors 2 ‘;’ were missing and I could see the error with Log.i(“tagconvertstr”, “[“+result+”]”);

The msg that it is showing is something like that :

[<br/ > font size = 1 table class=''xdebug-erroe' dir='ltr' ... loads of html code that wasn't in my initial code then....{"message":"Problem sending you the activation mail !"}]

So there’s a problem with the json format on that message “Problem sending you the activation mail” but the user was registered OK!

So the second time i would try that code it would show me in a correct json format : “This email has already been used” ! (without any errors) but i still can’t find the error in my php code : S

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement