API command sample for php?

For general discussion of the Poker Mavens software

API command sample for php?

Postby kingprado » Mon Dec 15, 2014 8:39 am

Hiiiiiiiiiiiii

Well, we got a problem with api command AccountsIncBalance , can I have a sample php code to how to use it?or a good reference for it

Regards
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Postby Kent Briggs » Mon Dec 15, 2014 10:20 am

kingprado wrote:Well, we got a problem with api command AccountsIncBalance , can I have a sample php code to how to use it?or a good reference for it


The API docs in the help file show:

AccountsIncBalance - increments the account balance of a player. Use a Player parameter to specify the player's name and an Amount parameter to specify the number of chips to add to the account. A "Balance" parameter is returned in the result indicating the player's new chip balance. This command is safe to use even while the player is logged in and playing.

What problem are you having?
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Postby kingprado » Mon Dec 15, 2014 12:26 pm

Kent Briggs wrote:
kingprado wrote:Well, we got a problem with api command AccountsIncBalance , can I have a sample php code to how to use it?or a good reference for it


The API docs in the help file show:

AccountsIncBalance - increments the account balance of a player. Use a Player parameter to specify the player's name and an Amount parameter to specify the number of chips to add to the account. A "Balance" parameter is returned in the result indicating the player's new chip balance. This command is safe to use even while the player is logged in and playing.

What problem are you having?



Actually I want to wrote a code for increasing the account amount but If I had a sample from one of the php samples for such api commands ( which it is correct and it's working , I could use all of commands easily....)

Thanks
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Postby Kent Briggs » Mon Dec 15, 2014 12:45 pm

Code: Select all
<?php
  include "API.php";
  $player = "test";
  $amount = 10;
  $params = array("Command" => "AccountsIncBalance", "Player" => $player, "Amount" => $amount);
  $api = Poker_API($params);
  if ($api -> Result == "Error") die("Error: " . $api -> Error);
  echo $amount . " chips added to balance for " . $player;
?>
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Postby kingprado » Wed Dec 17, 2014 10:37 am

Thank you for your ur kindness

May I have another sample for AccountsEdit command? I'm confused...
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Postby Kent Briggs » Wed Dec 17, 2014 10:58 am

Have you ever written PHP code (or any code before)?

Code: Select all
    <?php
      include "API.php";
      $player = "test";
      $location = "Houston";
      $params = array("Command" => "AccountsEdit", "Player" => $player, "Location" => $location);
      $api = Poker_API($params);
      if ($api -> Result == "Error") die("Error: " . $api -> Error);
      echo "Location for " . $player . " changed to " . $location;
    ?>
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Postby kingprado » Sat Dec 20, 2014 3:59 pm

Hi again,

May I have another example for Valcode command to verify account? And I want to use this code in my login page which I made it,May I have some guidance?I mean I want to make another form in my login page to be used for only Valcode to verify user's emails...

Best wishes
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Postby Kent Briggs » Sat Dec 20, 2014 4:34 pm

kingprado wrote:May I have another example for Valcode command to verify account?


Same as above except replace "Location" with "ValCode" or whatever property you want to edit. All the property names are documented in the API section of the help file.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests

cron