Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么按钮不是';即使php没有';不要弄坏它 使用谷歌登录 请格式化您的代码。如果$openid->mode的计算结果为true,则不会显示该按钮。 <?php require 'openid.php'; try { _Php - Fatal编程技术网

为什么按钮不是';即使php没有';不要弄坏它 使用谷歌登录 请格式化您的代码。如果$openid->mode的计算结果为true,则不会显示该按钮。 <?php require 'openid.php'; try {

为什么按钮不是';即使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) {

为什么按钮不是';即使php没有';不要弄坏它

使用谷歌登录

请格式化您的代码。如果
$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();
}