I'm working with openid library and one thing has been bodering me.
<?php
# Logging in with Google accounts requires setting special identity, so this example shows how to do it.
require 'openid.php';
try {
# Change 'localhost' to your domain name.
$openid = new LightOpenID('localhost');
if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = 'https://www.google.com/accounts/o8/id';
header('Location: ' . $openid->authUrl());
}
?>
<form action="?login" method="post">
<button>Login with Google</button>
</form>
<?php
} elseif($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
when we click the button it gives ?login to the page and then the php checks it and redirects it to the page it must be redirected but the thing is after the login (in google or etc) the button will not be shown , if you want to see the example completly I uploaded it to http://dota2tradebots.com/googlelogin.php to test it yourself and see what I mean.
why isn't the button be shown after the login is complete ?