Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (32 loc) · 790 Bytes

README.md

File metadata and controls

40 lines (32 loc) · 790 Bytes

SteamAuth

Sign in through Steam library for PHP.

This is only intended for basic webpages. For bigger projects use this only as an example to build your own.

Features

  • Callbacks for login, logout, and login failure
  • Easy login
  • POST Logout

Requires

  • PHP >= 5.4

Simple example

include("SteamAuth/SteamAuth.class.php");
$auth = new SteamAuth();
$auth->Init();

if(isset($_POST['logout']))
{
	$auth->Logout();
}

if($auth->IsUserLoggedIn()) 
{
	echo "Your SteamID is " . $auth->SteamID . "<br/>";
	echo "<form method=\"POST\"><input type=\"submit\" name=\"logout\" value=\"Logout\" /></form>";
} 
else 
{
	echo "<a href=\"" . $auth->GetLoginURL() . "\"><img src=\"assets/sits_large_noborder.png\" alt=\"Sign in through Steam\" /></a>";
}