Skip to content

Instantly share code, notes, and snippets.

@Immortal-
Last active December 22, 2015 00:00
Show Gist options
  • Save Immortal-/6386123 to your computer and use it in GitHub Desktop.
Save Immortal-/6386123 to your computer and use it in GitHub Desktop.
Example usage of AuthPanel
<?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