PHP code example of fisk / steam-openid

1. Go to this page and download the library: Download fisk/steam-openid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fisk / steam-openid example snippets


$client = new \SteamOpenID\SteamOpenID("http://example.com");

if ($client->hasResponse()) {
    try {
        $result = $client->validate();
        print("Signed in as {$result}!");
    } catch (Exception $e) {
        print($e->getMessage());
    }
} else {
    // redirect the user to Steam, however this is done in your app
    header('Location: '.$client->getAuthUrl());
}