Well this is my index.php file:
<?php
require 'openid.php';
try {
$openid = new LightOpenID('localhost');
if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = 'http://steamcommunity.com/openid';
header('Location: ' . $openid->authUrl());
}
?>
<form action="?login" method="post">
<button>Login with Steam</button>
</form>
<?php
} elseif($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
With that it echo's out:
"User http://steamcommunity.com/id/**ID HERE OF USER WHO LOGGED IN**/ has/has not logged in."
So I tried to echo out $openid->identity(); & validate() before the "User ------" but it would just give me:
Fatal error: Call to undefined method LightOpenID::identity() in D:\wamp\www\index.php on line 19
And if I do it after the "User ----------", it will print out "http://steamcommunity.com/id/**/ has/has not logged in". So my question is, how would I only print out the actual ID and not the rest? And could someone explain the -> stuff, I believe it has something to do with OOP, but yer.