I am new to code-igniter. In my View I added this code to enable google login in my website.
<html lang="en">
<head>
<meta name="google-signin-scope" content="profile email">
<meta name="google-signin-client_id" content="720765566138-5c6jreo4r7ma6cm0hdblj5cmjtdiruk4.apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer> </script>
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn" data-onfailure="onFailure" data-theme="dark"></div>
<script>
function onFailure(msg){ console.log(msg); }
function onSignIn(googleUser) {
console.log("onSignIn");
var profile = googleUser.getBasicProfile();
var user_name = profile.getName();
var id = googleUser.getAuthResponse().id;
};
</script>
</body>
</html>
How can I send the variable user_name and id to the Controller so that I can call the Model to insert the value to the database.