I managed to get the user information using Google+ login.
if (isset($authUrl)) {
echo "<a href='" . $authUrl . "'><img src='img/google.png'></a>";
} else {
print "ID: {$id} <br>";
print "Name: {$name} <br>";
print "Email: {$email } <br>";
print "Image : {$profile_image_url} <br>";
print "Cover :{$cover_image_url} <br>";
print "Url: {$profile_url} <br><br>";
echo "<a class='logout' href='?logout'><button>Logout</button></a>";
}
This is in a login.php
file where the user logs in. How can I pass this data to the header.php
so I can remove the Login and Register buttons and add the user name and image?