Player Info API

For discussion of the Poker Mavens server module and other administration topics

Re: Player Info API

Postby KillerxKen » Mon Aug 19, 2013 11:43 pm

What about the part that says header? and those variables?
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Postby KillerxKen » Mon Aug 19, 2013 11:59 pm

Here is a completed PHP(you still need to add dressing) for a PlayerInfo Page. You can echo back whatever information you wish to the player now.(see AccountsGet in API for complete list), Thanks Mr Briggs for all your help in getting it working.This will not log them into your poker software, but simply request the information requiring a password to see it.


Code: Select all
<?php

  $server = "http://ur.site.numbers.here/api";   // set your url here
  include "API.php";  // $pw and $url set in this file

  if (isset($_POST["Login"]))
  {
    $player = $_POST["Player"];
    $password = $_POST["Password"];
    $params = "Password=$pw&Command=AccountsPassword" . "&Player=" . urlencode($player) . "&PW=" . urlencode($password);
    $api = Poker_API($url,$params,true);
    if ($api["Result"] != "Ok") die($api["Error"] . "<br/>" . "Click Back Button to retry.");
    if ($api["Verified"] != "Yes") die("Password is incorrect. Click Back Button to retry.");
    $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>";
    exit;
  }
?>

<html>
<body>
 
  <h3>Poker Login</h3>
  <form method="post">
    <table>
      <tr>
        <td>Player Name:</td>
        <td><input type="text" name="Player"></td>
      </tr>
      <tr>
        <td>Password:</td>
        <td><input type="password" name="Password"></td>
      </tr>
      <tr>
        <th colspan="2"><input type="submit" name="Login" value="Login"></th>
      </tr>
    </table>
  </form>

</body>
</html>
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Previous

Return to Site Administration

Who is online

Users browsing this forum: No registered users and 2 guests

cron