Confirm code:

"; $code = $_GET['code']; echo "

Code: $code

"; $ga = new GoogleAuthenticator(); // Code verify with your secret and the supplied code. // Discrepancy is set to '2' which is 60 seconds. Default is 1 (30 seconds) but you might be too late to input the code. $login = $ga->verifyCode($secret, $code, $discrepancy = 2); // If login returns TRUE if ($login) { echo "OK"; } else { echo "FAILED"; } ?>