Advertisement
Guest User

Untitled

a guest
Jul 13th, 2013
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. # Logging in with Google accounts requires setting special identity, so this example shows how to do it.
  3. require 'openid.php';
  4. try {
  5.     # Change 'localhost' to your domain name.
  6.    $openid = new LightOpenID('http://seamkard.com');
  7.     if(!$openid->mode) {
  8.         if(isset($_GET['login'])) {
  9.             $openid->identity = 'http://steamcommunity.com/openid';
  10.             header('Location: ' . $openid->authUrl());
  11.         }
  12. ?>
  13. <form action="?login" method="post">
  14.     <button>Login with Steam</button>
  15. </form>
  16. <?php
  17.     } elseif($openid->mode == 'cancel') {
  18.         echo 'User has canceled authentication!';
  19.     } else {
  20.         echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
  21.     }
  22. } catch(ErrorException $e) {
  23.     echo $e->getMessage();
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement