解析数据的另一个错误org.json.JSONException:类型java.lang.String的值<!DOCTYPE无法转换为JSONObject

I'm pulling my hair out on this. I can write into a database with the same code (expect it's the INSERT INTO command) but this doesn't work.

PHP:

$id = $_POST['id'];
//$id = '000000000002';
$uri = $_POST['uri'];
//$uri='sdfgdsfg';
try {

    $stmt = $conn->prepare("UPDATE USERS SET PHOTO=? WHERE ID=?");
    $stmt->execute(array($uri, $id));
    $response["success"] = 1;
    } catch(PDOException $e) {
    echo 'ERROR: ' . $e->getMessage();
    $response["success"] = 0;
}

echo json_encode($response);

JAVA:

try {
                        paramsC = new ArrayList<NameValuePair>();
                        paramsC.add(new BasicNameValuePair("id", userid));
                        paramsC.add(new BasicNameValuePair("uri", "hello"));

                        JSONParser jsonParser; jsonParser = new JSONParser();
                        JSONObject json = jsonParser.makeHttpRequest(set_profile_photo_uri, "POST", paramsC);

                        try {
                            int success = json.getInt("success"); //error points to this line
                            if (success == 1) {
                                // successfully updated
                                Log.d("SIGNUP", "success");
                            } else {
                                Log.d("SIGNUP", "fail");
                            }
                        }catch(JSONException e){
                            //Log.e("log_tag", "Error parsing data "+e.toString());
                            //Log.e("log_tag", "Failed data was:
");
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

I get an error:

02-17 21:37:45.104: E/JSON Parser(21276): Error parsing data org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject
02-17 21:37:45.104: W/System.err(21276): java.lang.NullPointerException
02-17 21:37:45.124: W/System.err(21276):    at com.example.myapp.TabFragment1$8.onClick(TabFragment1.java:171)

However, this code works, but WHY?:

try {
        $stmt = $conn->prepare("INSERT INTO USERS (USERNAME, PASSWORD, NAME, EMAIL, GENDER, DATEOFREG_PHONE, DATEOFREG_SV) VALUES
        (:username, :password, :name, :email, :gender, :dateofreg_phone, :dateofreg_sv)");
            $query_params = array( 
                ':username' => $username,
                ':password' => $password,
                ':name' => $name,
                ':email' => $email,
                ':gender' => $gender,
                ':dateofreg_phone' => $dateofreg_phone,
                ':dateofreg_sv' => $dateofreg_sv
            );  
        $stmt->execute($query_params); 
        $response["success"] = 1;
        } catch(PDOException $e) {
        echo 'ERROR: ' . $e->getMessage();
        $response["success"] = 0;
    }

    echo json_encode($response);

The PHP code works fine when I enter it into the browser.

Making an answer from comments to close this question: Make sure you send a query to a right URL.