SyntaxError: Unexpected token C in JSON at position 0 in Ionic

I want to save data to MySQL using AngularJS.But I ran into a problem and did not.Adding data is happening.Also a blank line is added at the same time.Blank line first, then the data.
image

insert.html

<ion-view view-title="Dashboard">
 <ion-content class="padding"> 
  <form ng-submit="submit()">
     <div class="list">
        <label class="item item-input">
              <span class="input-label">Name</span>
              <input type="text" ng-model="data.name">
        </label>
        <label class="item item-input">
             <span class="input-label">Surname</span>
             <input type="text" ng-model="data.surname">
        </label>
        <label class="item item-input">
             <span class="input-label">Mail</span>
             <input type="text" ng-model="data.mail">
        </label>
 </div>
    <button class="button button-block button-positive" button class="button button-block button-positive" ng-click="submit()">
  Register
    </button>
  </form>
  </ion-content>
 </ion-view>

controller.js

angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope,$http) {
  $scope.data = {};


 $scope.submit = function(){      
      $http.post("http://localhost:8080/insert.php", {
        'name' : $scope.data.name,
        'surname': $scope.data.surname,
        'mail' :  $scope.data.mail 
      }).then(function(response){
            console.log("Data Inserted Successfully");
        },function(error){
            alert("Sorry! Data Couldn't be inserted!");
            console.error(error);

        });
}


})

insert.php

<?php

header("Content-Type: application/json; charset=UTF-8");
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');

 $servername = "localhost";
 $username = "root";
 $password = "";
 $dbname = "ionic";

$conn = new mysqli($servername, $username, $password,$dbname);

$data = json_decode(file_get_contents("php://input"));

  $ad = $data->ad;
  $soyad = $data->soyad;
  $mail = $data->mail;




// Create connection


 // Check connection
 if ($conn->connect_error) {
     die("Connection failed: " . $conn->connect_error);
 } 
    echo "Connected successfully";


   $sql = "INSERT INTO user (ad,soyad,mail)
     VALUES ('".$ad."','".$soyad."','".$mail."')";



       if ($conn->query($sql) === TRUE ) {
        echo "New record created successfully";
    } else {
          echo "Error: " . $sql . "<br>" . $conn->error;
 }

  $conn->close();

?>

I’m waiting for your help