PHP code example of xpaw / steam-openid
1. Go to this page and download the library: Download xpaw/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/ */
xpaw / steam-openid example snippets
use xPaw\Steam\SteamOpenID;
$SteamOpenID = new SteamOpenID( $ReturnToUrl );
if( $SteamOpenID->ShouldValidate() )
{
try
{
$CommunityID = $SteamOpenID->Validate();
echo 'Logged in as ' . $SteamID;
}
catch( Exception $e )
{
echo 'Login failed';
}
}
else
{
header( 'Location: ' . $SteamOpenID->GetAuthUrl() );
}