<?php
echo "<a href='".$client->createAuthUrl()."'><button>Login with Google</button></a>";
?>
Im trying to add class for <a href>
inside php echo , but i cant do any style what i want to do
<?php
echo "<a href='".$client->createAuthUrl()."'><button>Login with Google</button></a>";
?>
3
Answers
You can try something like this, I hope it will help you.
Your use of single quotes and double quotes is a little mixed up. I should also add that buttons inside a tags aren’t really correct. I’d suggest removing the button and styling the a tag instead. With that in mind, here are the options:
Regular CSS method
then in the stylesheet:
Inline styling Method
From a google development stand point im going to ask why are you doing it like that? Just redirect the user using the location header if you can detect they aren’t logged in.
index.php
login.php
relevant code from my Oauth2Authentication class.
oauthcallback.php