谷歌验证怎么玩
今天工作刚好用到了分享下
一、到官网下载类文件在php中引入
地址:https://github.com/PHPGangsta/GoogleAuthenticator
二、直接上代码,有注释
<?php
//引入类文件
require_once ("goole/GoogleAuthenticator.php");
class checkcode {
public function code(){
$ga = new PHPGangsta_GoogleAuthenticator();
// 创建新的"安全密匙secret"
$secret = $ga->createSecret();
//指定用户名
$name = "admin";
//第一个参数是"标识",第二个参数为"安全密匙SecretKey