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

后端 未结 5 2231
孤独总比滥情好
孤独总比滥情好 2020-11-29 11:11

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

5条回答
  •  余生分开走
    2020-11-29 11:32

    try preventing any output before your print and change the print to echo

    you may also remove the closing ?> to prevent further output after the php script

    
                        
                            Registration confirmation.
                         ';
    
                        ini_set('SMTP','relay.skynet.be');
    
                        if(mail($destinataire,$sujet,$message,$from)){
                            $msg = 'Check your mailbox to activate your account !'; 
                        }           
                        else{
                            $msg = 'Problem sending you the activation mail !'; 
                            $req = mysql_query("DELETE FROM userTable WHERE colUserLogin = '".$pseudo."' ");
                        }
                }
                else{
                    $msg = 'Problem inserting you in our database !';
                }
            }else{
                    $msg = 'This email has already been used !';
            }
            mysql_free_result ($req);   
    
        }else{
            $msg = "Connexion problem with de DB"
            print(json_encode(array("message" => $msg)));       
        }
    
    }else{
            $msg = "Couldn't treat your datas"
    }
    ob_end_clean()
    echo(json_encode(array("message" => $msg)));
    

提交回复
热议问题