Re: Player Info API
Posted: Mon Aug 19, 2013 11:43 pm
What about the part that says header? and those variables?
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>