Fatal error: Call to undefined function curl_init() in C:\wamp\www\poker\api.php on line 8
Código PHP:
<?php
include "API.php"; // API $url and $pw values set here
// Fetch the Site Name using the SystemGet API command.
$params = "123456=" . $pw . "&Command=SystemGet&Property=SiteName";
$api = Poker_API($url,$params);
$result = $api["Result"];
if ($result == "Error") die("Error: " . $api["Error"]);
$sitename = $api["Value"];
// Fetch the list of players using the AccountsList API command.
$params = "123456=" . $pw . "&Command=AccountsList&Fields=Player,Balance";
$api = Poker_API($url,$params);
$result = $api["Result"];
if ($result == "Error") die("Error: " . $api["Error"]);
// Iterate through the players in the response and create a associative
// chips array keyed on player name.
$accounts = $api["Accounts"];
$chips = Array();
for ($i = 1; $i <= $accounts; $i++)
{
$player = $api["Player" . $i];
$chips[$player] = $api["Balance" . $i];
}
// Sort array in decending order.
arsort($chips);
// Display results in an html table.
echo "<table border='1' cellpadding='5'>\r\n";
echo "<tr><th colspan='3'>$sitename - Chip Leaders</th></tr>\r\n";
echo "<tr><th>Rank</th><th>Player</th><th>Balance</th></tr>\r\n";
$rank = 0;
$total = 0;
foreach ($chips as $p => $c)
{
$rank++;
$total += $c;
echo "<tr><td>$rank</td><td>$p</td><td>$c</td></tr>\r\n";
}
echo "<tr><td colspan='2'>Total chips</td><td>$total</td></tr>\r\n";
echo "</table><br>\r\n";
?>