Account balance
Posted: Sun Jan 30, 2011 10:53 am
Hello, I have a simple question for all of you, and very complicated for me.
I want to show the balance of a particular player on the website, I want to use this function:
function Poker_API($url,$params,$assoc)
{
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_POST,true);
curl_setopt($curl,CURLOPT_POSTFIELDS,$params);
curl_setopt($curl,CURLOPT_TIMEOUT,30);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$response = trim(curl_exec($curl));
curl_close($curl);
$api = Array();
if ($assoc) // associative array result
{
if (empty($response))
{
$api["Result"] = "Error";
$api["Error"] = "Connection failed";
}
else
{
$paramlist = Explode("\r\n",$response);
foreach ($paramlist as $param)
{
$namevalue = Explode("=",$param,2);
$api[$namevalue[0]] = $namevalue[1];
}
}
}
else // regular array result
{
if (empty($response))
{
$api[] = "Result=Error";
$api[] = "Error=Connection failed";
}
else
{
$paramlist = Explode("\r\n",$response);
foreach ($paramlist as $param) $api[] = $param;
}
}
return $api;
}
what are the next line so I can show the balance for the next player ?
Player : TEST
Password: 123456
Thank you !
I want to show the balance of a particular player on the website, I want to use this function:
function Poker_API($url,$params,$assoc)
{
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_POST,true);
curl_setopt($curl,CURLOPT_POSTFIELDS,$params);
curl_setopt($curl,CURLOPT_TIMEOUT,30);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$response = trim(curl_exec($curl));
curl_close($curl);
$api = Array();
if ($assoc) // associative array result
{
if (empty($response))
{
$api["Result"] = "Error";
$api["Error"] = "Connection failed";
}
else
{
$paramlist = Explode("\r\n",$response);
foreach ($paramlist as $param)
{
$namevalue = Explode("=",$param,2);
$api[$namevalue[0]] = $namevalue[1];
}
}
}
else // regular array result
{
if (empty($response))
{
$api[] = "Result=Error";
$api[] = "Error=Connection failed";
}
else
{
$paramlist = Explode("\r\n",$response);
foreach ($paramlist as $param) $api[] = $param;
}
}
return $api;
}
what are the next line so I can show the balance for the next player ?
Player : TEST
Password: 123456
Thank you !