为什么按钮不是';即使php没有';不要弄坏它 使用谷歌登录 请格式化您的代码。如果$openid->mode的计算结果为true,则不会显示该按钮。 <?php require 'openid.php'; try {
为什么按钮不是';即使php没有';不要弄坏它为什么按钮不是';即使php没有';不要弄坏它 使用谷歌登录 请格式化您的代码。如果$openid->mode的计算结果为true,则不会显示该按钮。 <?php require 'openid.php'; try { ,php,Php,为什么按钮不是';即使php没有';不要弄坏它 使用谷歌登录 请格式化您的代码。如果$openid->mode的计算结果为true,则不会显示该按钮。 <?php require 'openid.php'; try { # Change 'localhost' to your domain name. $openid = new LightOpenID('localhost'); if(!$openid->mode) {
使用谷歌登录
请格式化您的代码。如果$openid->mode
的计算结果为true,则不会显示该按钮。
<?php
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();
}