Player Info API
-
- Posts: 27
- Joined: Mon Aug 12, 2013 7:18 pm
Player Info API
I was wondering if anyone knew: what would be the correct PHP to display players their basic info such as Username,total balance,chips in play(tourn and ring), and email. I would like to have it where this page is displayed right after one logs in, ala sealwithclubs. So I also need to figure out how to get the page to remember username with fetch command, so when the page loads it loads only the logged in players info ever. thanks for any advice
Ken
Ken
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Player Info API
AccountsGet is the API command for that, or at least everything except tournament chips (which have no relation to a player's chip balance).KillerxKen wrote:I was wondering if anyone knew: what would be the correct PHP to display players their basic info such as Username,total balance,chips in play(tourn and ring), and email.
-
- Posts: 27
- Joined: Mon Aug 12, 2013 7:18 pm
Re: Player Info API
I dont want it to display ALL the info/fields though, just those things listed, how would I do that?>
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Player Info API
AccountsGet reports about 2 dozen fields but you would just grab the ones you care about and ignore the rest. For example, something like this (untested):KillerxKen wrote:I dont want it to display ALL the info/fields though, just those things listed, how would I do that?>
Code: Select all
include "API.php";
$player = "player_name_here";
$params = "Command=AccountsGet&Password=$pw&Player=$player";
$api = Poker_API($url, $params, true);
if ($api["Result"] != "Ok") die($api["Error"]);
echo "Chip balance for $player is " . $api["Balance"] . "<br>";
echo "Email for $player is " . $api["Email"] . "<br>";
-
- Posts: 27
- Joined: Mon Aug 12, 2013 7:18 pm
Re: Player Info API
thats what i was missing, thanks so much Mr. Briggs, and continued best of luck with this great product.
-
- Posts: 27
- Joined: Mon Aug 12, 2013 7:18 pm
Re: Player Info API
how would I get it to remember the players name?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Player Info API
Depends on what "it" is. In what context is your code being used? If the player is logging into your web site, they would be entering their own name into a form input. Or it's fetched from a cookie that you set. If you are running stats for every player you can fetch the whole list the AccountsList command in the API. Otherwise you could be saving and retrieving names from your own database.KillerxKen wrote:how would I get it to remember the players name?
-
- Posts: 27
- Joined: Mon Aug 12, 2013 7:18 pm
Re: Player Info API
meaning when i have them login(to my webpage, not the software)and they are then sent to a page we will call "playerinfo.php" . I want the AP to remember atleast their username if not also the password, so the page displays the information we want.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Player Info API
That's typically done with a cookie on your login page. Then you would pass that to your php script via POST parameter.KillerxKen wrote:meaning when i have them login(to my webpage, not the software)and they are then sent to a page we will call "playerinfo.php" . I want the AP to remember atleast their username if not also the password, so the page displays the information we want.
-
- Posts: 27
- Joined: Mon Aug 12, 2013 7:18 pm
Re: Player Info API
I cant just have them submit their name and password to a login/form and just have it send back that info?