function onSignIn(googleUser) {
  var profile = googleUser.getBasicProfile();
  // console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
  // console.log('Name: ' + profile.getName());
  // console.log('Image URL: ' + profile.getImageUrl());
  // console.log('Email: ' + profile.getEmail());


$.ajax({
  url:'http://localhost/connection.php',
  data: {
    name: profile.getName(),
    imageUrl: profile.getImageUrl(),
    email: profile.getEmail(),
    id: profile.getId()
  },
  type:'post',
  success:function(data){
    $("html").html(data);

  },
  error:function(err){
    console.log(err);
  }
});
}

function signOut() {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
      console.log('User signed out.');
    });
  }





