Last active
December 22, 2015 00:00
-
-
Save Immortal-/6386123 to your computer and use it in GitHub Desktop.
Example usage of AuthPanel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('authcode_class.php'); | |
/*-- Making an authcode --*/ | |
$A = new Authcode(); | |
$name = 'Testuser'; | |
$salt = '1234565789!'; | |
$_code = $A->make($name,$salt); | |
echo $_code; | |
/*-- Checking an authcode --*/ | |
$returnval = $A->check($name,$salt,$_code); | |
echo ' | ' . $returnval; | |
/*-- Getting name from authcode --*/ | |
$username = $A->getName($_code); | |
echo ' | ' . $username; | |
/* | |
RETURN: | |
dGVzdHVzZXI6NDM5YjA1YjM= | Valid | testuser | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment